Saturday, February 25, 2012

connection error

Hi guys, my asp.net web page was working fine on my laptop. Until i transferred it into my friend's.. an error msg popped out. My SQL Northwind database was been copied over but still there seems to be a problem with the connection, can any one help me?
Personal guess: You are using an sa username/password in the connection string, and the other server you are connecting to is not set up for SQL security, only Windows security.
Show the connection string you are using (with any passwords obscured, of course).
|||

SqlConnection conn=new SqlConnection("server=localhost;uid=sa;pwd=;database=Northwind");

SqlCommand cmd = conn.CreateCommand();

cmd.CommandText = "SELECT * FROM tblDoor";

conn.Open();
//how to find out what user id to use?

|||Do you have SQL Server or MSDE? If SQL Server, then you should be able to use Enterprise Manager to try and figure out what the SA password is, as well as determining whether SQL Server security is enabled. If you have Enterprise manager, right click the SQL Server and select Porperties. In the properties window, go to the Security tab make sure authentication is set to SQL Server and Windows.|||oh it is working already, thanks man!

No comments:

Post a Comment