出于任何原因,我遇到了一个错误,即对象引用未设置为对象的实例..
这是我的代码请帮我解决我的问题提前谢谢..
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GetUserScraps(int.Parse(Request.QueryString["id"].ToString()));// this line have such error..
}
}
public void GetUserScraps(int id)
{
string getUserScraps = "SELECT r.uid ,r.unm,p.photo,s.uid,s.unm,s.text,s.date,s.sid FROM register as r, status as s, profile as p WHERE p.pid.s.sid AND r.email=p.email AND s.id='" + Request.QueryString["id"].ToString() + "'";
dt = dbClass.ConnectDataBaseReturnDT(getUserScraps);
if (dt.Rows.Count > 0)
{
GridViewUserScraps.DataSource = dt;
GridViewUserScraps.DataBind();
}
}