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 14960Post New Mind Tree ADO.NET Interview Questions
when reinforcement binding completed if there is more cover than the required what is the solution to reduce the cover?
What does orm consists of?
What is m_dump?
WHAT IS THE TECHNICAL SPECIFICATION OF C CURVE & D CURVE LEGRAND MAKE MCB
What is sql prepared statement?
What is flush programming?
What is odbc and jdbc in dbms?
How does FDDI node determine whether it can send asynchronous traffic and synchronous traffic
04. a. Slenderness ratio…………… 1 b. If the height of a stage is 15-0 & dia. of the prop is 5, the slenderness ratio is….… 1 c. If the height of a stage is 10-0 & dia of prop is 3, the number of bracing will be…… 1
Do you view contain data?
How would you fit a linear model over a scatter-plot?
What is meant by query override?
In Dissolution Test why limit is define Q+5% what is the role of +5%.
How do I override the default home page loaded by tomcat?
What is void pointer in c++ with example?