Sunday, July 12, 2009

Data Grid in ASP.Net(C#)?

I was binding data to the data grid from database.I'm using 3 template coulmns for edit,view n delete property.I'm writing the code for do this operations.But it didn't work.The following is the code that I'm using.


private void dgjobs_ItemCommand(object sender,DataGridCommandEventArgs e)


{





switch(e.CommandName)


{


case "Select":


Response.Redirect("Job Posting.aspx?id=" +dgjobs.DataKeys[e.Item.ItemIndex].ToStr...


break;


case "Delete":


SQL.NonQuery("DeleteJob "+dgjobs.DataKeys[e.Item.ItemIndex].ToSt...


dgjobs.DataSource=SQL.SQLTable("S... " + Session["cid"].ToString());


dgjobs.DataBind();


break;


case "View":


{


Response.Redirect("ViewPosting.as...


break;


}


}


}





Will you help me?

Data Grid in ASP.Net(C#)?
Your code is not displaying correctly above.





You didn't specify whats the problem.





You can figure it out by yourself through debugging your code flow of control.





click next to to your switch statement. Press F9. This creates a break point. Run your page under debug mode (through pressing F5). The execution stops at your break point. place the pointer over your variables to see their values. Press F10 to step through your code. That's how you debug your page!


No comments:

Post a Comment