using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class viewSingleNews : System.Web.UI.UserControl
{

    protected void grdFill()
    {
        FirstClass db = new FirstClass();
        DataTable dt = new DataTable();

        dt = db.dbOut(@"SELECT     TOP 100 PERCENT tblKhaterat.NewsID AS nwsID, tblKhaterat.NewsTitle as nwsTitle, tblKhaterehGroup.NewgGroupDescription as nwsGroup,  Users.Name + N'  ' + Users.Sname AS Expr1, tblKhaterat.DateOfAdding as nwsDtadd, tblKhaterat.NewsPic, tblKhaterat.newsBody as nwsBodyes
                       FROM  tblKhaterat INNER JOIN Users ON tblKhaterat.UserName = Users.UserName INNER JOIN tblKhaterehGroup ON tblKhaterat.NewsGroupID = tblKhaterehGroup.NewsGroupID WHERE     (tblKhaterat.NewsID = '"+ int.Parse(Request.QueryString["NewsID"].ToString()) +"') ORDER BY tblKhaterat.NewsID DESC"); //NewsID

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        grdFill();
    }
}
