Connecting to SQL Server from VB .Net application

Miha1711

New member
Joined
Aug 18, 2009
Messages
2
Hello! :) I want to connect to SQL Server from my VB .Net application... Can anyone tell me correct server information that will work?
Code:
Dim objConn As New SqlConnection("Server=[B][COLOR="SeaGreen"]IPorWhateverGoesHere[/COLOR][/B];uid=***;pwd=***;database=***")
objConn.Open()
 
Server = the main server IP or the dedicated IP for the account if it has one
uid = this will be the username you specified when you created the database
pwd = the password you specified when you created the database
database = the name of the database obviously

You might find this link helpful but also remember that you need to specify which remote IPs can connect to your database. This can be done from within the mysql admin section inside DA.

I hope this helps, but if you need help with the syntax of your VB .net application this wouldn't be the place to ask.
 
Thanks for reply :)

I Found out IP Address (127.0.0.1) in phpMyAdmin's documentation. But now it says:

Code:
Login failed for user 'username'. The user is not associated with a trusted SQL Server connection.

Even if I try to connect with program (Visual Basic 2008) says that connection is not trusted. :(
 
127.0.0.1 is the ip reserved for every computer to refer to itself. So if the script is running on a different server than the mysql server and you use the 127.0.0.1 address then its trying to connect to itself and not the mysql server.

You need the real ip address of the mysql server.
 
Hello! :) I want to connect to SQL Server from my VB .Net application... Can anyone tell me correct server information that will work?

SQL Server is a Microsoft product, which runs on Microsoft servers. Are you writing us about connecting to MySQL on a Linux or Unix server running DirectAdmin? If not, you're in the wrong place.

Jeff
 
Back
Top