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();
If we want to connect to many databases in dataaccess layer
such as MSAccess,Sql server,oracle means not to a particular
database depends on condition we have to connect to
appropriate database in this scenario if we without changing
code Ho wdo you handle this situation?
If a table contains 20000 records . In a page at each time
100 records to be displayed. What are the steps u will take
to improve performance? will you use dataset or datareader?
The answers which posted above is not satisfied my
requirement? Can some one post teh exact answer? Thanx
126
What are the differences between RAW, AUTO and Explicit
modes in retrieving data from SQL Server in XML format?
282
how can implement dropdownlist in particular of dataset
when try to update?
196
Can we create Synonymns in MS Acess,My Sql Server,Sql
Server?
But iam we can create in oracle!
52
oledbdataadpter with ms access in c#.net giving exception
System.Data.OleDb.OleDbException while writing
adapter.update(dataset,"tabname"); how to update the
database from dataset?