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
 SQL Server Administration (2005)
 SQL database wont attach to my C# program

Author  Topic 

siten0308
Starting Member

4 Posts

Posted - 2008-06-25 : 10:40:47
Hello,

Right now i am running SQL 2005 server and using Visual studio C# 2008 to program. I sadly have a Windows Vista professional, 320gbhd, 2gb ram, intel duel core processor, The problem is on C# you can attach a database to your program to retrive or import information from the user to the database and have C# make a nice gui interface to interact with which i am trying to do, however the steps i am taking in C# is column called data, add data source, choose type, SQL, browse to the MDF file or database, attach it but when i click ok, it thinks or gives me the hour glass then it finally says An error has occured while establing a connection to the server. when connecting to sql 2005, this failure may be caused by the fact that under default settings sql does not allot remote connection." i checked the management and area configuration and checked remote and local settings enabled everything except via on protocal and remote connections, made sure it allows local and remote connections and still the same error message, i have administrative rights on this pc, everything is all local, what am i doing wrong?

dshelton
Yak Posting Veteran

73 Posts

Posted - 2008-06-26 : 01:03:09
Have you checked your port settings?
Go to Top of Page

gedwards
Starting Member

19 Posts

Posted - 2008-06-26 : 08:10:25
Are you on SP2 for SQL server? I recall a Vista provisioning option at the end.

Greg E
Go to Top of Page

siten0308
Starting Member

4 Posts

Posted - 2008-06-26 : 11:22:59
Hello

Hey gedwards, i have made sure i have the latest updates, i had sp1 for sql 2005 server, is that the latest for vista? dshelton, how do i check my port settings, remember this is all local all on the same computer, but if it is ports for sql, how do i check it and what do i need to check?
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-06-26 : 11:33:38
goto RUN-> Cliconfg and check to see if you have Protocols enabled in the client configuration. ADD Alias in the cliconfg for the server you are trying to connect.

Maninder
Go to Top of Page

siten0308
Starting Member

4 Posts

Posted - 2008-06-26 : 12:40:57
Hello Dshelton, sorry i tried that and it did not work (wish it did though) but i also tried to detach the database from SQL but still did not work, same error message WHATS THE DEAL!!! any other ideas guys i am willing to try anything besides give up so easily.
Go to Top of Page

gedwards
Starting Member

19 Posts

Posted - 2008-06-26 : 13:32:52
Here's a lists of the builds since SP2 for SQL 2005.

http://support.microsoft.com/kb/937137/

Vista Provisioning was at the end of the SP2 install. Getting on the latest build can only help.

Greg E
Go to Top of Page
   

- Advertisement -