myAdapter = new MySqlDataAdapter(); myAdapter.InsertCommand = new MySqlCommand(myQuery, myCon); myData = new DataSet(); myAdapter.Fill(myData, "myTable");
When you create a new row or modify a row the changes it inflicts are reflected to its underlying source (a datatable or dataset). So to send the changes or get the changes you could see the underlying source. To send updates to the database you could use a DataAdapter.Update command...
[C#]need help to write in database the datagridview rows text
Jonathan - UK internet Services
Im still having trouble.
I try in the follow way:
myAdapter = new MySqlDataAdapter();
myAdapter.InsertCommand = new MySqlCommand(myQuery, myCon);
myData = new DataSet();
myAdapter.Fill(myData, "myTable");
myGrid.DataSource = myData;
myGrid.DataMember = "myTable"
myParam = new MySqlParameter();
myParam = myAdapter.InsertCommand.Parameters.Add("@myVariable", MySqlDbType.VarChar);
myParam.SourceColumn = "myColumn";
myParam.SourceVersion = DataRowVersion.Current;
myAdapter.Update(myData, "myTable");
in this case, my insert query is;
string myQuery = "INSERT INTO myTable (myColumn) VALUES(@myColumn)";
so.....after all...still doesnt work :(
supervlad
Only needed to assign a column index at "@MyColumn" and it worked.
Fauteux Guy
Hi,
When you create a new row or modify a row the changes it inflicts are reflected to its underlying source (a datatable or dataset). So to send the changes or get the changes you could see the underlying source. To send updates to the database you could use a DataAdapter.Update command...
cheers,
Paul June A. Domag
sirji
so....which is the value of "@myColumn"