How would u connect to database using .NET?

Answer Posted / rathish

go to project->add reference->adodb

DECLERATION

Dim con As ADODB.Connection
Dim cmd As ADODB.Command
Dim str, cnstr, sql As String
Dim cn As OleDb.OleDbConnection


FORM LOAD

Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
con = New ADODB.Connection
con.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\new folder\employee.mdb")
End Sub

in the source you have to give the path of ur file name..

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is connection string?

708


Explain what is datagrid with an example?

806


What is ado.net components?

675


What is the advantage of ado.net?

744


What is the difference between Data adaptor and Data set?

748


What is the difference between Dataset. clone and Dataset.copy?

760


Explain executenonquery?

785


What is the use of data grid?

693


What is data view and variable view?

661


What is DataReader Object?

772


how we can fire event in databound coulm in datagfrid withot using button?

736


What is microsoft ole db provider for sql server?

643


Which is better ole db or odbc?

666


What is ado recordset?

676


What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

774