Hi Mike,
First of all I never do it this way, I made a sample to try it myself
first.
It did what I though it would do.
But I did test nothing further.
So I don't know if there are side effects.
The sample is bellow
I made a project with 2 forms
I made on form1 a connection draging the SQLadapter on form1 and connected
it the Nortwind table employees
On every form I did drag a datagrid and on the first one a button.
I did using the designer to change the datasource of the datagrid on form1
to dataset11.employees
Than I added the code bellow
The form did show up with the information on form1 in the datagrid
When I did push on button1 the datagrid with the information was showed on
form2 in the datagrid.
I hope this helps?
Cor
\\\
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Button1_Click(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.DataSet11 = DataSet11
frm.ShowDialog()
End Sub
Private Sub Form1_Load(ByVal sender As _
Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(DataSet11)
End Sub
End Class
///
\\\
Public Class Form2
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Friend WithEvents DataSet11 As WindowsApplication8.DataSet1
Private Sub Form2_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.DataGrid1.DataSource = DataSet11.Employees
End Sub
End Class
///
I can create a dataset class using the solution explorer, and I can create
a global instance of it on my main form. I can then use that instance as a
datasouce in a table in code.
What I can't do is to use that global dataset in the designer as the
datasouce. I guess the datasouce property doesn't show datasouces unless
they are bound to forms somehow at design time. That's what I'm trying to
accomplish.
It sounds like you are saying this can be done in the forms class
definition somehow, but I don't know exactly how to do this.