Link to home
Start Free TrialLog in
Avatar of moonis_ahmed
moonis_ahmed

asked on

how to pass textbox data into a datagridview on a separate form in vb.net

Hi, I have eight textboxes and corresponding labels on one form and one button. i have another form with a datagridview. On the click of the button on form1 i want to pass the content of the textboxes and corresponding labels' text into the datagridview on form2 only for those textboxes which are not empty. I would greatly appreciate a help in this matter in the form of syntax since i am a beginner in vb.net

Note: Its a vb.net windows application
ASKER CERTIFIED SOLUTION
Avatar of k1karim
k1karim
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of srikanthreddyn143
srikanthreddyn143

Or you can make a dataset in Form1 and Initialize Form2 with this dataset and load it.

Ex:

In Form1.
Add up all rows to dataset
Dim f2 As New Form2()
f2.Init(ds)
f2.show()

In Form2
Dim localds As DataSet
Public Sub Init(byVal ds As DataSet)
{
localds  = ds
}

publicSub  Load()
{
GridView1.DataSource = localds
Gridview1.DataBind()
}