Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

How to pass value from form2 to form3 in vb.net

hello there im making a programme that generate sqlserver code to use it in my vb.net progarrme

i have first form conatain the connection like you see in picture below
[Image: 0OrPt]
the connection is works 100%
but in second form i have 2 datagridview
1- for tables
2- for fields

so when i click in any table of data gridview1 => datagridview2 show it fields

but when i clike on datagridview1 to get the value of combobox form form1 to use it in form2 i have error

https://imgur.com/a/TYjMq

Failed to connect to server.

my script
Dim frm As New Form2
prd.ServerConnection = New ServerConnection(frm.ComboServer.Text) ' here the error
prd.DGVField(MetroGridTables, MetroGridField)

so i use form1 to making connection and form2 to make operation but i have
Failed in connection to server.
(Mar 20, 2017 07:56 AM)Visual Freedom Wrote:  You can use a module for shared objects.

^^This is the best way to do it.

I believe you can also do it by passing it through a public method, but I would recommend you avoid doing that.
[Image: a7CglB3.gif]
how that !!!! can you explain
Pass the the values as parameters in the constructor of the other form. If that doesn't fit your needs then use a shared module or even the Settings class (or whatever its called).


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by NotAFedSep 10, 2018 09:21 PM 8 328 Sep 10, 2018 09:21 PM
Last Post: BahNahNah
[.NET] by EffexionApr 16, 2018 02:48 AM 4 196 Apr 16, 2018 02:48 AM
Last Post: Effexion
[.NET] by Moon RockJul 22, 2016 07:53 AM 2 218 Jul 22, 2016 07:53 AM
Last Post: Moon Rock