Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlExec Equivalent?
Message
From
31/10/2007 09:51:02
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Vista
Database:
VistaDB
Miscellaneous
Thread ID:
01265186
Message ID:
01265357
Views:
12
As John mentioned, you can pass the DataTable to your Form when you instantiate it:
// You'll need an additional constructor in the MyForm class for this
MyForm oForm = new MYForm(dtTransDate);
if (oForm.ShowDialog() == DialogResult.OK)
{
    // put processing here
}
... or you can set it as a property:
// You'll need a "MyTable" Property in the MyForm class for this
MyForm oForm = new MYForm();
oForm.MyTable = dtTransDate;
if (oForm.ShowDialog() == DialogResult.OK)
{
    // put processing here
}
~~Bonnie


>John,
>You got me on the right track.
>
> DataTable dtTransDate = dSRA.Tables["RATRANS"].DefaultView.ToTable(true, "transdate");
>
>It returns a distinct result like I wanted but it only seems to work on my main form. For now I have this in the rightmouse event of a button on my main form.
>
>My intent was to have another form or dialog pop up and provide the combobox with the distinct dates. If I move the statement to the second (called) form my dataset (dSRA) is not known.
>
>Do I need to pass the databale or dataset as a reference to the new form in some way?
>
>Sorry for all the questions but I'm very new at the whole C# thing. And if this is way beyond a simple answer just say so.
>
>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform