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();
i making a project using windows application c#, i want to
show user name, password, and one button login. i wanna
make it with sealed class .how its possible . when i
clicked my login button all project should be open. pls
cleare me.
59
how to add a selected row of a gridview to another gridview
without reloading the page??
149
OleDbDataAdapter ole=new OleDbDataAdapter(new OleDbCommand
("select * from login",oleDbConnection1));
OleDbCommandBuilder cmd=new
OleDbCommandBuilder(ole);
ole.Fill(dataSet11,"login");
DataRow drow=dataSet11.Tables
["login"].NewRow();
drow[0]=textBox1.Text;
drow[1]=textBox2.Text;
drow[2]=textBox3.Text;
dataSet11.Tables["login"].Rows.Add
(drow);
ole.UpdateCommand=cmd.GetUpdateCommand();
ole.Update(dataSet11,"login");
MessageBox.Show("one row added");
this gives exception.how to solve it
The answers which posted above is not satisfied my
requirement? Can some one post teh exact answer? Thanx
48
What are the differences between RAW, AUTO and Explicit
modes in retrieving data from SQL Server in XML format?
110
how to create a quiz software using 4 options to answer
and how to check with answers in the database and award
marks....
86
How do we invoke queries from the application
61
What are the advantages of oledb compared with other
classes?
78
how can implement dropdownlist in particular of dataset
when try to update?
95
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?