Question DataGridView - VB 2010

Simple Man

Member
Joined
Jul 7, 2010
Messages
13
Programming Experience
5-10
I've got a data table in my dataset that is a "stand alone" table. There are no table adapters that fill this data table...I fill the data table using code. I want this data table used as a temp table that will populate a crystal report. Let me call this datatable CRData

From Form1, I press a button and it inserts 5 records. I also have a datagridview on Form1 that is updated once the data is entered. I then can see the 5 records that is in CRData. Now, from Form1 i open up Form2. On Form2 there is also a datagridvidw that should be bound to CRData, but nothing is displayed in this datagridview. How can I view CRData on Form2, which it is populated from Form1?

Thanks.
 
Last edited:
If nothing is displayed then you're doing something wrong. If we don't know what you're doing then we can't know what you're doing wrong.

At a guess, I'd say that the two forms each have their own DataSet. If I have a glass and you have a glass, filling my glass with water doesn't make your glass fill up too. The same goes for programming objects. If one form has a DataSet and another form has a DataSet, populating one has no effect on the other. If you want to populate a DataSet on one form and display it on another then that's what you must do. You must have one DataSet that both forms reference. If Form1 creates Form2 then the logical option would be for Form1 to create the DataSet and pass it to Form2.

That's just a guess though. For all I know you are already doing that and the issue is something else entirely.
 
Back
Top