Board index » Visual Studio » Saving changes made in DataGridView
|
Edson
|
Saving changes made in DataGridView
Visual Studio344
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a Windows Forms program with a DataGridView and a BindingSource added to a form. Here is the code I'm using to populate the grid: Dim CRClassesTableAdapter As SqlDataAdapter Dim CRClassesTable As New DataTable() Dim connectionString As New SqlConnection("Initial Catalog=" & My.Settings.Database & ";Data Source=" & My.Settings.Server & ";Integrated Security=SSPI;") CRClassesTableAdapter = New SqlDataAdapter("Select * from CRClasses", connectionString) CRClassesTableAdapter.Fill(CRClassesTable) BindingSource1.DataSource = CRClassesTable BindingSource1.Filter = "fldCLStatus <>'Closed' AND fldStartDate>= '" & medStart.Text & "' AND fldStartDate <= '" & medEnd.Text & "'" BindingSource1.Sort = "fldStartDate, fldClassName" Grid1.DataSource = BindingSource1 Databse is in SQL Server 2000. I'm using VB2005. I would like each row to update once that row has lost focus. How would I do it? - |
