Multiple forms, binding and databases

  • Thread starter Thread starter sparkle
  • Start date Start date
S

sparkle

Hi,

I'm really stuck on a concept:

How do you get info from some tables(in this case using a dataAdapter
and dataset) from one form onto another form? Or does the db side
even matter?

Here is what I'm trying to do:

One form has a datagrid. I search for an employee, find the employee,
select the employee. I want to double click the employee's info in
the grid and have the second form popup. Then fill textboxes on that
second form with that same employee info I selected from the first
form's datagrid

I'm mostly stuck trying to figure out how to bind the info from the
datagrid to tell it to go into the new forms textboxes.

First Form:
Dim frmMain As New frmMain
grdEmployees.Select(grdEmployees.CurrentRowIndex)
frmMain.Show()

Second Form (called frmMain):
...frmMain_Load...
Me.txtEmpNum.Text =
frmSearch.grdEmployees.CurrentRowIndex.ToString("Emp_Num")

This doesn't work but shouldn't I have to say something like this:
Me.txtEmpNum.DataBindings.Add(frmSearch.grdEmployees.CurrentRowIndex.ToString("Emp_Num"))

Or what? Can anybody direct me to some content that will show me how
to resolve this?

Thanks alot,
 
Hi Sparkle,

Take the priciple in vb.net that you are not getting, however giving things
to properties from another class.

So when the user clicks, you set a property in your form2 which will be used
do display.

When you have a shared dataset, you can do it using that shared dataset.

I hope this gives some idea?

Feel free to ask more?

Cor
 
Back
Top