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 15199When we are running the Application, if any errors occur in the Stored Procedure then how will the server identify the errors?
HCL,
5 10150
Where is adodb dll located?
How to identify the controls which can be used for binding data?
What connected data?
What is method to get XML and schema from Dataset? getXML() and get Schema ()
What is untyped dataset?
What does adodb stand for?
What is ado asp?
What are the different row versions available in table?
Why edit is not possible in repeater?
Give few examples of datareader that is used in different dataproviders.
What is the use of sqldatareader class?
Explain ado.net features?
What is a control toolbox?
What is sqldatareader in ado.net?
Explain the role of data provider in ado.net?