0

I am helping my friend in his college final year project, Its an C# application in a client machine and it uses SQL server in the windows server 2008 environment.

VM ware environment:


3 clients(windows 7) and 1 SQL database (in windows 2008)

The connection between he server and the client is working, the port 1433 for SQL is open and its listening.

When I try to run the program am getting the following error.

Error Message when i run the SQL code in the application on button-click

This is the connection string which am using.

cn = new SqlConnection(@"Data Source=192.168.1.2,1433;Initial Catalog=Test;Integrated Security=True");

And i have also tried to refer this website for connection strings, but i don't know how it works.

http://www.connectionstrings.com/sql-server-2008

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN; Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

I am getting an error. Tried to give a simple username and password in the SQL server and tried it, still the same issue. please check the image. The Username and password which i used is the System login(windows authentication)

Error message when i use the username and password

I just want to access the SQL server in the Windows 2008 machine.

Where should i check the credentials for this connection string ?

Thank you soo much for reading this patiently.

2

2 Answers 2

1

You can go to Connectionstrings.com to get more information on connection strings and its usages.

Sign up to request clarification or add additional context in comments.

1 Comment

Thannkzz Rajesh, i did it successfully :), well good news is this project got 1st Grade.
0

Try removing the port from your connection string (1433 is the default SQL port):

cn = new SqlConnection(@"Data Source=192.168.1.2;Initial Catalog=Test;Integrated Security=True");

For a connection using sql authentication (which would eliminate trust issues between machines) use the following (replacing xxxx and yyyy with the appropriate user name and password):

cn = new SqlConnection(@"Data Source=192.168.1.2;Initial Catalog=Test;Integrated Security=False; User=xxxx; Password=yyyy");

1 Comment

Thannkzz Plymouth223, i did it successfully :), well good news is this project got 1st Grade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.