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 16276When we are running the Application, if any errors occur in the Stored Procedure then how will the server identify the errors?
HCL,
5 11798
What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?
Define Execute Reader?
What is the difference between Data adaptor and Data set?
What is a datareader object?
how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?
What is the DataTableCollection?
What is adodb dll?
can we create synonymn in ms access,sql server,my sql if so explain me with example
What is ado object model?
What is ado.net objects?
If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?
What is ado or jdbc?
What is the use of Dataview?
What do you know about ado.net's methods?
What does sqldatareader return?