Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 plz help

Author  Topic 

omairmustafa
Starting Member

1 Post

Posted - 2008-06-07 : 12:49:08
I installed visual studio 2005 then installed sql server management studio express. Previously I was using sql 2000 and i was using connection.cs file which had the following code:
namespace Pathology_Lab_GUI
{
/// <summary>
/// Summary description for connection.
/// </summary>
public class connection
{
//Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=se2project
//string connectionString="Data Source=(local);Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=se2 proect";
//string connectionString="server=127.0.0.1;database=se2project;uid=sa;pwd=sa";
string connectionString="server=.;database=Lab;uid=sa;pwd=sa";
//string connectionString="server=127.0.0.1;database=se2 proect;uid=Basic;pwd=";
//string connectionString="Data Source=(local);Integrated Security=SSPI;Initial Catalog=realstate_db"; //atif connection
//string connectionString = "server=(local);Integrated Security=SSPI;Persist Security Info=False;User ID=Basic;Initial Catalog=realstate_db";
SqlConnection objConn=null;



public connection()
{

objConn=new SqlConnection(connectionString);
objConn.Open();


}
public SqlConnection GetConnectionObject()
{
return objConn;
}
}
}
(c# code)

Now that I have sql 2005 this code doesnt work. when i execute the application it doesnt connect with the sql database. Plz help me out.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-07 : 13:32:17
Does sa account have password sa on your sql server 2005 instance?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-07 : 22:24:12
And try put sql instance name in connection string.
Go to Top of Page
   

- Advertisement -