By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,550 Members | 908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,550 IT Pros & Developers. It's quick & easy.

filling a datagrid

P: n/a
I want to fill a datagrid with different dataadapters.
The problem is to refresh the datagrid. How do I populate the datagrid with
different dataadapters?
I use buttons to do this
button1
Private Sub cmdAnsatt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt.Click
OleDbDAAnsatt.Fill(DsAnsatt)
'Me.Refresh()
End Sub
button2
Private Sub cmdAnsatt2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt2.Click
OleDbDAAnsatt3.Fill(DsAnsatt)
'Me.Refresh()
End Sub

This does not work
regards
reidarT
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Try something like this.

Private Sub cmdAnsatt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt.Click
dsansatt.clear
OleDbDAAnsatt.Fill(DsAnsatt)
datagrid1.datasource=dsansatt.tables(0)
End Sub
button2
Private Sub cmdAnsatt2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt2.Click
dsansatt.clear
OleDbDAAnsatt3.Fill(DsAnsatt)
datagrid1.datasource=dsansatt.tables(0)
End Sub

Ken
-----------------------------

"reidarT" <re****@eivon.no> wrote in message
news:OA**************@TK2MSFTNGP09.phx.gbl...
I want to fill a datagrid with different dataadapters.
The problem is to refresh the datagrid. How do I populate the datagrid with
different dataadapters?
I use buttons to do this
button1
Private Sub cmdAnsatt_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt.Click
OleDbDAAnsatt.Fill(DsAnsatt)
'Me.Refresh()
End Sub
button2
Private Sub cmdAnsatt2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdAnsatt2.Click
OleDbDAAnsatt3.Fill(DsAnsatt)
'Me.Refresh()
End Sub

This does not work
regards
reidarT

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.