Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 ado.net in mvc?

922


What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?

1332


What is ambient transaction?

940


What is ado code?

945


What are the important features of ado.net 2.0?

1071


What are all the different authentication techniques used to connect to MS SQL Server?

1072


What are the advantages of oledb compared with other classes?

2790


Explain the two fundamental objects in ado.net?

977


Describe ado.net object model in detail.

987


What is basic use of data view?

996


Explain the difference between ado and ado.net?

935


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

962


What is the difference between sqlcommand and sqldataadapter?

989


What is the use of data grid?

949


What is the advantage of ado.net?

1011