-
March 23rd, 2006, 05:33 AM
#1
Datagrid not refreshing properly?
Hy!
I'm writing some code with VS2005. In my code i have one form and one dialog. With dialog i enter a new record to a database which is access db. On my form i have datagrid with bindings where i show entrys from my database.
Problem is that when i enter a new record from my dialog, the datagridview is not updated.
When i load a form i fill a datagridview
Code:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PocitniskeDataSet.DataTable1' table. You can move, or remove it, as needed.
DataGridView1.Refresh()
Me.TableAdapter_zl.Fill(Me.PocitniskeDataSet.DataTable1)
End Sub
Can you please tell me where in my code should i refresh dataset?
-
March 23rd, 2006, 06:52 AM
#2
Re: Datagrid not refreshing properly?
create a dataset object and set it as the data source property of the datagrid. any changes made 2 the dataset will be reflected in the datagrid without having 2 write any code. at least, that's how it's done in .NET 2003. good luck
-
March 23rd, 2006, 11:16 AM
#3
Re: Datagrid not refreshing properly?
I'm showing DataTable1 in DataGridView as DataSource. DataTable1 is an table from my pocitniskeDataSet but still it's not working?
Any sugestions are very wellcome...
-
March 23rd, 2006, 11:43 AM
#4
Re: Datagrid not refreshing properly?
fill the dataadapter before calling the datagrid's refresh method
-
March 23rd, 2006, 12:24 PM
#5
Re: Datagrid not refreshing properly?
Originally Posted by Winx
fill the dataadapter before calling the datagrid's refresh method
Becouse i have just started with vs2005 and becouse i see that you are in a good mood...please Winx try to explain to me a little bit more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|