Since these days every body is working on ADO.net with Dataset,DataAdapter,DataReader e.t.c so what about those application which have been written using ADODB.Visual Studio.net allows you to use ADODB component in your application.
Follwing is the step by step tutorial of how to access data from your database by using recordset through vb.net application.
Goto your Microsoft Visual Studio click file from Menu bar then new Project you will see a window similar to the following:
Name the application and click “OK”
Click Project from menu bar and then select Add Reference as shown below:
Add Reference: Figure 1:
Microsoft Active DataObject Libray: Figure 3:
After selecting DataObject Libray you have to import ADODB:
1: Imports ADODB
Then you have specify a connection string
1: Public DBConnection As String = "PROVIDER=SQLOLEDB;PASSWORD=***;PERSIST SECURITY INFO=true;USER ID=**;INITIAL CATALOG=***;DATA SOURCE=***"
After writing connection string to open a connection use following syntax:
1: Dim Conn As New ADODB.Connection
Inorder to interact with you table you have to use ADODB command and recordset through following syntax:
1: Public rsperm As New ADODB.Recordset
2: Public cmdperm As New ADODB.Command
After declaring ADODB Recordset and Command write your SQL Statement in the rsperm and the open rsperm recordset.
1: cmdperm.CommandText = "select Edit,Viw,Validate from usermanagement where username='" & LoginForm.txtUsername.Text & "' and pasword='" & LoginForm.txtPassword.Text & "'"
CodeReflex is your foremost source of design practices, coding techniques and quality testing. Over here, you will get the solution of every known issue relevant to programming in mostly all of the top languages. Not only this but you can also download the code snippets by experts and freely incorporate into your project.