How To Update A Column In A DataGrid Using C#.NET? I am getting InvalidCastException as (Specified cast is not valid) while updating 2nd column in a datagrid? Id,firstname,lastname are the three columns of my datagrid respectively. I wanted to edit the second column(lastname) and update it. I did the following code in DataGrid's updatecommand(),but failed to update ! Int varid=(int)DataGrid1.DataKeys[e.Item.ItemIndex]; TextBox lnm=(TextBox)e.Item.Cells[2].Controls[0]; string str=lnm.Text ; SqlCommand cmd=new SqlCommand("update customer set lastname='" + str + "' where id=" + varid + "",con); cmd.ExecuteNonQuery(); DataGrid1.EditItemIndex=- 1; DataGrid1.DataBind();
2 16283Post New Mind Tree ADO.NET Interview Questions
How can I set the default rwx permission to all users on every file which is created in the current shell?
What are splunk buckets? Explain the bucket lifecycle?
Which sub module of sap could make business areas obsolete and can one business area be assigned to several company codes? And what is z transaction?
What is the difference between inner class and nested class?
what is the effect of duration of earth quake on framed structures ?
Differentiate between the PROC SUMMARY and PROC MEANS?
You are the project manager for Insomniacs International. Since you don't sleep much, you get a lot of project work done. You're considering recommending a project that costs $575,000, and expected inflows are $25,000 per quarter for the first 2 years, and then $75,000 per quarter thereafter. What is the payback period? A. 40 months B. 38 months C. 39 months D. 41 months
How do I see the actual raw sql query generated by ci's active record
What are the four types of bookmarks in QlikView?
State the top.NET class that everything is derived from?
What does a Spark Engine do?
What happens to index when table is dropped?
What does @test(invocationcount=?) And @test(threadpoolsize=?) Indicate.
Name few python web application frameworks?
What is powerpoint and how does it work?