Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I connect to a database of another computer in the same local network using VB.NET? We have already enabled remote connection in the SQL Server configuration and the SQL browser, and we already connected with one another using wireless network. Here is our connection in VB.NET:

Data Source=NEWUSER0602akz\SQLEXPRESS;Initial Catalog=sample;Integrated Security=True

Is there something wrong with this? When I input data, it always shows me the error:

A network-related or instance-specific error occurred while establishing to SQL Server

Why it is always showing this, even though we already set the remote connection?

share|improve this question
    
Did you specify the port? –  Synetech Feb 26 '12 at 22:42
    
This question has been edited twice but no one has questioned the confusion over "MySQL" in the title and SQL Server in the body. Is it possible that the poster meant "my SQL" - i.e. "the SQL server that is mine" and not MySQL? The grammar in the original unedited question implies English as a second language. –  Dave Becker Feb 26 '12 at 23:32

1 Answer 1

You say your database is MySQL but in your connection string you are trying to connect to a server named "SQLExpress", which would certainly be a Microsoft SQL Server Express instance, not MySQL.

In Visual Studio (or Visual Studio Express), use the Server Explorer, right click on "Data Connections", and select "Add Connection" Then click "Change" on the Data Source field - as shown here:

enter image description here

You then select your data provider:

enter image description here

As shown, MySQL is not one of the supported database programs in a standard installation of Visual Studio. However, there are plenty of (Free) choices for a .NET/MySql data provider - Google for "mysql .net data provider". Install one, follow the steps above, and you should be all set.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.