Re: Calling a .vb file function!!
Instantiate an object of that VB file's class, then the object will expose the function to you.
Re: Calling a .vb file function!!
ok...That nice...!!!! but...i have take values from that aspx page..(from text box)..so how i call those text boxes in .vb file..i' just giving my ROUGH code here of .vb file...
--------------------------------------------------------------------------
Public Function insert()
Dim sqlConn As SqlConnection
Dim sqlCmd As SqlCommand
Dim sqlCmd2 As SqlCommand
sqlConn = New SqlConnection("data source=SHANTASOFTDC;persist security info=False;user id=root;")
sqlConn.Open()
sqlCmd = New SqlCommand("Insert User_login_info(username,password,user) values('" & tbox3 & "','" & tbox4 & "','User')", sqlConn)
sqlCmd2 = New SqlCommand("Insert User_detail_info(firstname,lastname,phone,street,city,state,zip,country,Othercont)values('" & tbox1 & "','" & tbox2 & "','" & tbox6 & "','" & tbox7 & "','" & tbox8 & "','" & tbox9 & "','" & tbox10 & "','" & tbox11 & "')", sqlConn)
sqlCmd.ExecuteNonQuery()
sqlCmd2.ExecuteNonQuery()
sqlConn.Close()
------------------------------------------------------
Thanx!!!
Re: Calling a .vb file function!!
You'll have to change it. Make the insert() function accept arguments. Make this whole thing a class.
From the ASP.NET page's codebehind, instantiate an object of that class, and then call it like:
Code:
objectname.insert(TextBox1.Text, textbox3.Text, TextBox7.Text)
Re: Calling a .vb file function!!
Re: Calling a .vb file function!!
Add [Resolved] To the thread title.