Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Calling a function

$
0
0
good day guys.. can you help me how to call a function from form1 to form2?
here is my code.. and its error..


*** FORM1 ***
[code]
Public Sub SQLConn()

connection = New SqlConnection("Data Source=PC-PC\SQLEXPRESS;Initial Catalog=health center;User ID=sa;Password=pwd")

End Sub
[code]


( then i want to call the code and use it in form2 )


*** FORM2 ***
[code]
Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

call FORM1.SQLConn()

[code]

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>