Hi,
I am using vb.net 2005. I need, how to use the coding from one form to another form. I have two more forms like, Login form, Registration form, Calculation form.
I used the same code to each forms. But i need i wrote the common code only in one form and it used to another forms without wrote the each forms.
for ex.
Imports System.Data
Imports System.Data.OleDb Public Class Form1
Dim con As OleDbConnection
Dim com As OleDbCommand
Dim adp As OleDbDataAdapter
Dim reader As OleDbDataReader
Dim ds As DataSet Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
.
.
.
.
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\gopi\password\pass.mdb")
con.Open()
End Sub
End Class
The above bold code will be use in another form. I need to use it without write into another form. Is it possible? if possible means please explain with example.
Thanks
Gopi A