selecting DataSource of a DataGrid when the dataset is in a different form?

  • Thread starter Thread starter Sam74
  • Start date Start date
S

Sam74

Hi, I'm writing a program with Microsoft Visual C# .net version 2002
the program has 4 Forms
and all the database components (DataSet, OleDbDataAdapter, OleDbConnection)
are in form4
as I've got DataGrids in the other forms,
if I go in one of these forms
in the datagrid property, selecting the DataSource I can't select the
dataset in form4
how can I see the dataset in form4 from the other forms?
thankyou
Sam
 
Sam74 said:
Hi, I'm writing a program with Microsoft Visual C# .net version 2002
the program has 4 Forms
and all the database components (DataSet, OleDbDataAdapter, OleDbConnection)
are in form4
as I've got DataGrids in the other forms,
if I go in one of these forms
in the datagrid property, selecting the DataSource I can't select the
dataset in form4
how can I see the dataset in form4 from the other forms?
thankyou
Sam
DataSets are global (project namespace, not members of a form), aren't they?
 
You may want to create a Class that holds that dataset as a Property and at
runtime bind it accordingly. If you use it as a Static property, you should
be ok.

Cheers,

Bill
 
Back
Top