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.Controls; 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 14085
what is the syntax code for oldb to connect oracle?2 3178
When we are running the Application, if any errors occur in the Stored Procedure then how will the server identify the errors?
how to keep track of index in listbox items.2 4163
How do we invoke queries from the application2 2735
Define connection string?
What are the different ado.net namespaces?
What are the advantages of oledb compared with other classes?
What is the advantage of ado.net?
Explain how to bind the controls(best practice) comboboxes to the data in the dataset?
Explain the two fundamental objects in ado.net?
How can we load multiple tables in to dataset?
What are the namespaces used in ADO.Net to connect to a database?
What is difference between executenonquery and executequery?
What is the provider being used to access oracle database?
Explain the dataadapter class in ado.net?
What is difference between datagridview and datagrid control in winforms?
What is meant by entity framework?
Explain the difference between an ado.net dataset and an ado recordset?
What is ado.net architecture?