Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am a VB .NET novice, so here is an easy one, I hope?

 

I have a dataset which hold 2 tables - 1. Client details

2. ZipCode

 

I have a form (Form1)where I can edit a clients details. on that screen I have a combo box ( which contains info from Zipcode table in the dataset) where the user can choose the city. When the city is chosen the ZipCode is automatically entered from my dataset.

 

If the ZipCode is not in the dataset I want the user to be able to add it via Form2 which will open by clicking a button on Form1.

 

Can anyone tell me how I can read and update the dataset in Form1 from Form2?

 

Thankyou.

Posted

You can pass the dataset to Form2 throught its constructor

 

if Form2:

 

Dim ds As DataSet

 

Public Sub New(ByVal d as DataSet)

ds=d

End Sub

 

in Form1:

 

Dim f As New Form2(mydataset)

f.ShowDialog()

Proudly a Palestinian

Microsoft ASP.NET MVP

My Blog: wessamzeidan.net

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...