answersLogoWhite

0

How do you make connection with database in vb.net 2005?

Updated: 8/16/2019
User Avatar

Wiki User

14y ago

Best Answer

Imports system.data

Imports system.data.oledb

Module Module1

Sub Main()

Dim con As New OleDbconnection

Dim cmd As New OleDbcommand

Dim dr As OleDbDataReader

con = New OleDbConnection("provider=microsoft.jet.oledb.4;data source=D:/student")

con.Open()

Console.WriteLine("connection is open /successful")

cmd = New OleDbCommand("select * from std", con)

dr = cmd.ExecuteReader()

Do While dr.Read()

Console.WriteLine(dr("rno"))

Console.WriteLine(dr("name"))

Loop

dr.Close()

con.Close()

Console.ReadLine()

End Sub

End Module

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make connection with database in vb.net 2005?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What do you mean by database driver?

JDBC which is short for java database connectivity is used to connect database to a java project . To make connectivity a database driver is required to establish the connection.


How do you connet sql and vbnet?

You can connect MySql and vbnet by download something called MySql Connecter. After you do that add the resource to your project and add this code.Code:'Put this at the top of your codeImports MySql.Data.MySqlClient'Then right click your form and add this codePrivate mysql_host = "Change this to your MySql Host"Private mysql_user = "Change this to your MySql User"Private mysql_pass = "Change this to your MySql Password"Private mysql_db = "Change this to your Database"Private SqlConnect As String = "server=" + mysql_host + ";user id=" + mysql_user + "; password=" + mysql_pass + "; database=" + mysql_dbPrivate SqlConnection As New MySqlConnection'Then double click your form and in the form load put this in.SqlConnection.ConnectionString = SqlConnectTryIf SqlConnection.State = ConnectionState.Closed ThenSqlConnection.Open()MsgBox("Sucessfully Connected To Mysql Database")ElseSqlConnection.Open()MsgBox("Connection is closed.")End IfCatch ex As ExceptionMsgBox(ex.Message)End TryTheir you go, you now you can make a stable connection with your mysql host, and database!


How do you make DVD burner in vbnet?

just click the button


What is an SQL server connecton string?

An SQL server connection string contains information that providers need to know in order to establish a connection to a database. There are many ways to write a connection string because each provider has multiple ways to make a connection.


How do you make connection string in ASP-net with Microsoft access?

use OLEDB connection string OleDbConnection con=new OleDbConnection("provider=microsoft.jet.oledb.4.0;data Source=[your database name.mdb]");


How do I fix establishing a database connection error in WordPress in 5 minutes?

As the name refers to Error Establishing Database Connection in WordPress, this error tells that the website is unable to connect the database. It happens when there is some issue with the database. To solve this issue, you should do remedies that are as follows:• Heavy traffic on the website: Sometimes, the website gets huge traffic, due to the server is unable to respond and connect to the database. In such a situation, you should wait and try after a while.• The corrupted database is also a reason that becomes the reason for database connection failure• Wrong login credential leads to this error so make sure you are using correct login details• The damaged WordPress files can also be one of the reasons for the database connection error.• Contact your web host provider to rectify the problem as soon as possible• Restore the default WordPress file; it might help to get website in normal mode• Disable corrupted themes and pluginsVisit here for more details: http s://wordpresserror500.c om


What is the explanation for the role of the database administrator?

A database administrator oversees all aspects of the database. He/she will be the person who has the ability to make anything happen with the management of the database.


What is the duration of Make the Connection?

The duration of Make the Connection is 1800.0 seconds.


What are the database management activities?

Make sure the database does not run out of space. Nowdays no manual intervention is required in products from major database vendors like Oracle. Make sure the database jobs are running with no issues. Configure, Schedule backups Make sure backup and recovery procedures work as configured. Database security is another task.


Who is a database designer?

A database designer is a person who specifies how a database records are stored, accessed and related to make sure there is adequate performance!


What rhymes with database?

Make a case


When was Make the Connection created?

Making the Connection was created on 2011-10-02.