|
-
May 13th, 2008, 03:17 AM
#1
SQL server connection
I am trying to connect to a sql database on another computer on the network. I am trying to establish a data connection using the server explorer. Only when i test the connection i get this error.
The file "\\ukbrixp185\mysite\RSMDatabase.mdf" is on a network path that is not supported for database files.
Cannot attach the file '\\ukbrixp185\mysite\RSMDatabase.mdf' as database 'RSMDatabase'.
Can anyone tell me what i am doing wrong.
Last edited by Matthew.Cross; May 13th, 2008 at 03:22 AM.
-
May 13th, 2008, 03:46 AM
#2
Re: SQL server connection
nono, youre not connecting to a database on another computer. what youre doing is connecting to your local instanc eof SQLServer and then trying to get it to use a data file stored on a network drive. This has horrible performance implications. What you should be doing is ensuring that SQLS is installed on the UKBrixP185, that it is using c:\wherever\path\RSMDatabase.mdf as its data store, and then you should be connecting to it with a proper connection string, something like:
Driver={SQL Native Client};Server=UKBrixP185;Database=RMSDatabase;Uid=sa;Pwd=pass;
-
May 13th, 2008, 03:49 AM
#3
Re: SQL server connection
Ideally you should not have your MDF files on a separate network share.
What happens when you try to connect to the database using Management Studio? Does it let you connect?
Also take a look at
http://support.microsoft.com/kb/304261
-
May 13th, 2008, 04:35 AM
#4
Re: SQL server connection
What i am trying to acheive is this. There is a database on a SQL server called ukbrixp185. The database name is RSMDatabase.mdf. I have written an application than needs to query information contained in aforementioned database. My problem is, how do i connect to this database using c#, i can connect if the database is local but not remote. This is the first time i am using SQL server so any help would be much appreciated.
-
May 13th, 2008, 06:32 AM
#5
Re: SQL server connection
 Originally Posted by Matthew.Cross
What i am trying to acheive is this. There is a database on a SQL server called ukbrixp185. The database name is RSMDatabase.mdf. I have written an application than needs to query information contained in aforementioned database. My problem is, how do i connect to this database using c#, i can connect if the database is local but not remote. This is the first time i am using SQL server so any help would be much appreciated.
You haven't said much about how you are attempting the connection. You said earlier that you are using the Server Explorer. Can you give more details? Are you using Sql Server Authentication or Windows Authentication? Can you see the server on the screen (there should be a drop down/combo box that allows you to see the accessible servers)? Once you've picked the server and the authentication method the dialog should give an updated list of databases available. If you can't see the database you're looking for there then you cannot connect to it. Do you have any SQL Server tools like Sql Server Management Studio? What version of SQL Server are you using, 2000 or 2005 or higher?
-
May 13th, 2008, 06:53 AM
#6
Re: SQL server connection
 Originally Posted by nelo
You haven't said much about how you are attempting the connection. You said earlier that you are using the Server Explorer. Can you give more details? Are you using Sql Server Authentication or Windows Authentication? Can you see the server on the screen (there should be a drop down/combo box that allows you to see the accessible servers)? Once you've picked the server and the authentication method the dialog should give an updated list of databases available. If you can't see the database you're looking for there then you cannot connect to it. Do you have any SQL Server tools like Sql Server Management Studio? What version of SQL Server are you using, 2000 or 2005 or higher?
From inside my c# project i use the server explorer treeview and click add new connection which brings up add connection dialog. From the server name drop down combi i can select the server i want. I am using windows authentication. In the select or enter database drop down i get no list of databases, what i have been doing is selecting attach database file and browsing for it. What do i need to do to get the database in the drop down. The server iam using has SQL 2005 on it and also my development machine has SQL 2005 installed.
Thanks for the help i am not really clued up on SQL server.
-
May 13th, 2008, 11:07 AM
#7
Re: SQL server connection
 Originally Posted by Matthew.Cross
In the select or enter database drop down i get no list of databases, what i have been doing is selecting attach database file and browsing for it. What do i need to do to get the database in the drop down. The server iam using has SQL 2005 on it and also my development machine has SQL 2005 installed.
Hi there,
Do you know who owns the database? Should the database be permanently attached? If you don't see anything in the list of databases it could mean that the database is not attached or that the server is not configured to allow remote access (the default for Sql Server 2005). Do you have DBA there? It should be straightfoward to configure this. But I think it has to be done on the actual server using the SQl Server Surface Area Configuration tool. One of the tabs there manage remote connections. By default remote connections are not allowed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|