I am sure that there is way to avoide the redundance of generating the commands and the dtataset2 in every web form
I use vb.net and ado.net with access.
I have a database with 18 tables
En every webform(aspx) i have used the server explorer and dragged the database to the form itself. After that I generated the dataset.
This has created multiple lines of code like
Me.OlDbSelctCommand1 = New System.Data.OleDb.OleDbCommand
Me.OlDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OlDbInsrtCommand1 = New System.Data.OleDb.OleDbCommand
Me.OlDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
and so on for my 18 tables
Now how can I avoid this code on my second and third web form?
Can I create a class with the common code?
Can somebody give me an example of how to do this?
I use vb.net and ado.net with access.
I have a database with 18 tables
En every webform(aspx) i have used the server explorer and dragged the database to the form itself. After that I generated the dataset.
This has created multiple lines of code like
Me.OlDbSelctCommand1 = New System.Data.OleDb.OleDbCommand
Me.OlDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OlDbInsrtCommand1 = New System.Data.OleDb.OleDbCommand
Me.OlDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
and so on for my 18 tables
Now how can I avoid this code on my second and third web form?
Can I create a class with the common code?
Can somebody give me an example of how to do this?