Hi,
I am a beginner in vb.net. I have installed Visual studio 2005 along with Sql Server coming in the same DVD. I can't connect to Sql server from vb.net as local host. Can you give basic connection procedures to connect with Sql server.
Thanking you
Rayees
Connect to SQL ServerI want to connet SQL Server in locahhost
Page 1 of 1
3 Replies - 3135 Views - Last Post: 24 October 2009 - 08:50 PM
Replies To: Connect to SQL Server
#2
Re: Connect to SQL Server
Posted 24 October 2009 - 03:25 AM
Hi
You can connect to SQL server through the visual studio interface by adding a data source to your project, you can also create your database with the visual studio interface.
See this
http://www.dreaminco...wtopic74598.htm
You can also create an SQL database then hard code your project with SQL queries to access the tables in your database of which there are loads of examples in the snippets and tutorial sections here. Get something going then if you have any problems post your code and the errors you are getting and the guys here will be glad to help.
Hope this helps
You can connect to SQL server through the visual studio interface by adding a data source to your project, you can also create your database with the visual studio interface.
See this
http://www.dreaminco...wtopic74598.htm
You can also create an SQL database then hard code your project with SQL queries to access the tables in your database of which there are loads of examples in the snippets and tutorial sections here. Get something going then if you have any problems post your code and the errors you are getting and the guys here will be glad to help.
Hope this helps
#3
Re: Connect to SQL Server
Posted 24 October 2009 - 08:18 AM
I always use this
Dim connection As New SqlClient.SqlConnection(Data Source=Myserver;Initial Catalog=Mydatabase;Integrated Security=True)
Dim command As New SqlCommand
command.Connection = connection
command.Connection.Open()
command.CommandTimeout = 1000000
Dim connection As New SqlClient.SqlConnection(Data Source=Myserver;Initial Catalog=Mydatabase;Integrated Security=True)
Dim command As New SqlCommand
command.Connection = connection
command.Connection.Open()
command.CommandTimeout = 1000000
#4
Re: Connect to SQL Server
Posted 24 October 2009 - 08:50 PM
I used MySQL for my SQL server and used db4free.net For my database. Here is the register form to register for a Database its easy and quick and FREE here it is db4free Register form
Also here are some vids from a GREAT friend of mine
Visual Basic Login Using a Database
Visual Basic MySQL Login
Here is my source code of what I used.
If You Need Any Help PM Me Or Add Me Rain.Disaster@hotmail.com
Also here are some vids from a GREAT friend of mine
Visual Basic Login Using a Database
Visual Basic MySQL Login
Here is my source code of what I used.
If You Need Any Help PM Me Or Add Me Rain.Disaster@hotmail.com
Dim MySqlConnection As MySqlConnection MySqlConnection = New MySqlConnection() MySqlConnection.ConnectionString = "server=db4free.net;Port=3306; user id=your user ID; password=Your Pass; database=Your Database;" MySqlConnection.Open() Dim myadapter As New MySqlDataAdapter Dim sqlquary = "SELECT * FROM Users WHERE Username = '" & TextBox1.Text & "' AND Password = '" & TextBox2.Text & "';" Dim command As New MySqlCommand command.Connection = MySqlConnection command.CommandText = sqlquary myadapter.SelectCommand = command Dim mydata As MySqlDataReader mydata = command.ExecuteReader()
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|