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;
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
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.
Re: SQL server connection
Quote:
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?
Re: SQL server connection
Quote:
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.
Re: SQL server connection
Quote:
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.