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
What is ado.net in mvc?
What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?
What is ambient transaction?
What is ado code?
What are the important features of ado.net 2.0?
What are all the different authentication techniques used to connect to MS SQL Server?
What are the advantages of oledb compared with other classes?
Explain the two fundamental objects in ado.net?
Describe ado.net object model in detail.
What is basic use of data view?
Explain the difference between ado and ado.net?
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?
What is the difference between sqlcommand and sqldataadapter?
What is the use of data grid?
What is the advantage of ado.net?