mce
March 18th, 2008, 03:12 AM
hi,
beginner questions..
1)
i am binding a datagrid view to a sql database. How can i make it such a way that if i change the data in the grid view, the same data will get updated into the database?
2)if i want to update a particular field in my sql database, how to do it in csharp? i manage to write codes as below only, after much searching in the internet.
SqlConnection myConnection = new SqlConnection("Data Source=(local); Trusted_Connection=yes");
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter("select * from Table1", myConnection);
However,,,
NOTE: When i add a datagridview and bind it to my database, visual studio (2008) automatically created the following for me.
table1TableAdapter
table1BindingSource
testDataSet
I have one table in my DB. I just lost on how to make use of this to update my DB. I believe it is possible for me to use the above objects to update individual field in my DB?
beginner questions..
1)
i am binding a datagrid view to a sql database. How can i make it such a way that if i change the data in the grid view, the same data will get updated into the database?
2)if i want to update a particular field in my sql database, how to do it in csharp? i manage to write codes as below only, after much searching in the internet.
SqlConnection myConnection = new SqlConnection("Data Source=(local); Trusted_Connection=yes");
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter("select * from Table1", myConnection);
However,,,
NOTE: When i add a datagridview and bind it to my database, visual studio (2008) automatically created the following for me.
table1TableAdapter
table1BindingSource
testDataSet
I have one table in my DB. I just lost on how to make use of this to update my DB. I believe it is possible for me to use the above objects to update individual field in my DB?