Here is the problem:
I have a datagridview which is binded by datasource using wizard,I am using SQL2005 as the backend.
I am saving the changes in the database and I have a datagridview which shows all the saved records but after I save the changes in database,my datagridview does not show the immediate change.
the connection to Datagridview is via wizard so
Me.TotTabTableAdapter.Fill(Me.Equation1DataSet.TotTab)
the above line appears after connection to database.
I have tried
SqlDatagridview1.Refresh()
I have tired the below code which took me 1 step ahead but with problems.
Me.TotTabTableAdapter.Dispose()
Me.TotTabTableAdapter.Fill(Me.Equation1DataSet.TotTab)
The above code refresh's the grid but saves all the enteries in the grid again,I don't understand why.
To solve the saving problem,I also tried with EndEdit function which would indicate end of edit mode
Me.TotTabBindingSource.EndEdit()
Me.TotTabTableAdapter.Dispose()
Me.TotTabTableAdapter.Fill(Me.Equation1DataSet.TotTab)
But still the result is same.
The Saving of all the enteries again is may be because of the line
Me.TotTabTableAdapter.Fill(Me.Equation1DataSet.TotTab)
I have also tried 1 of my friend Jim's answer but still the problem exist
Datagridview1.datasource=nothing
Datagridview1.Datasource=Me.Equation1DataSet
My tries:
Datagridview1.datasource=nothing
Datagridview1.Datasource=Me.Equation1DataSet.TotTab
Datagridview1.datasource=nothing
TotTabTableAdapter.Update(Me.Equation1DataSet.TotTab)
Datagridview1.Datasource=Me.Equation1DataSet.TotTab
The result is still the same.Any thing other than the above mentioned tricks than please suggest.
I though this would be simple but I guess its not.
Please Help..
Thanks in advance.