Click here to Skip to main content
15,747,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application an published it on IIS. but when I am running that application it is not being connected with the database.
I am using sql server authentication mode to connect through database. It is not showing error also. Can you please guide me how connect database through sql server authentication mode.
And that application is running successfully when i am running through local host but not after publishing it on server
Updated 24-Feb-12 0:45am
ZurdoDev 24-Feb-12 7:54am    
If you are using SQL Server authentication mode you need to look at your connection string.
Qureshali 24-Feb-12 8:21am    
it is working correctly on local host then why not after publishing.
This is my connection string
Data Source=FTPserver;Initial Catalog=MockTestDatabase;User ID= TCOER;Password=TCOER
ZurdoDev 24-Feb-12 8:45am    
What is the error?

Write try.. catch block around DBConnection method. It will help to get the exact error.

  // dbconnection method
  // SqlConnection connection = new SqlConnection(connectionString);

catch (Exception ex)
Share this answer
Hi, check below point

1. First check Sql Server,open SQLServer and login on this using SQL Authentication, giving userid and pwd.

2. If First is correct then check your connection string in application, there are all parameters in connection string i.e. Server, Database, userid, password etc.

3. If first is incorrect then first login with windows authentication and change settings in sql, change to SQL Server Authentication and assign userid and password and save this setting.

4. now again login with using that uid and pwd.

Hopefully, it will solve your problem. :-)
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900