Click here to Skip to main content
15,896,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
error ocured while executing webpage.

plz suggest me some idea to solve my problem
thanks in advance.


DataBaseClass dbClass = new DataBaseClass();
       public DataTable dt;
       protected void Page_Load(object sender, EventArgs e)
       {
           if (!Page.IsPostBack)
           {
               GetUserScraps(int.Parse(Request.QueryString["id"].ToString()));//here i've met 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.unm='" + Request.QueryString["id"].ToString() + "'";
           dt = dbClass.ConnectDataBaseReturnDT(getUserScraps);
           if (dt.Rows.Count > 0)
           {
               GridViewUserScraps.DataSource = dt;
               GridViewUserScraps.DataBind();
           }
       }
Posted
Comments
Richard C Bishop 11-Apr-13 9:47am    
What line?
PRAKASH9 11-Apr-13 9:49am    
may be you cann't get the querystring
[no name] 11-Apr-13 9:49am    
Make "id" not null
mahi0607 11-Apr-13 10:01am    
my id is not null.
still getting error.
[no name] 11-Apr-13 10:10am    
Well then you are just going to have to debug your application, find out what is null and make it not null. We cannot do that for you.

1 solution

It seeme like Request.QueryString["id"] returns null. Maybe, there is no id value in the url.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900