Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys,

I have a asp.net application using sql server 2005 database it run on localhost fine but when i used on remote server database working. plz any one suggest me what to do

Thank you in advance.
Posted
Comments
André Kraak 24-Sep-11 4:11am    
Your question is to vague, please try rephrasing it and/or be more specific.
Please mentioned any error messages you are receiving and/or supply code that is relevant to your question.

If you wish to change your question use the Improve Question button.
RaisKazi 24-Sep-11 4:12am    
What error you are facing?
Sumit Kumar Singh India 24-Sep-11 5:22am    
Actually i want to host my site and i want to use database on remote server. no any exception occurs but no data found in database so i think i have to import database but i dont know how?
P.Salini 24-Sep-11 6:55am    
First insert data into database and then check.

The first thing to do is try to connect to the remote database using either SQL Server Management studio or VS via the Server explorer window. If you can do this, then the properties pane can show you the connection string which will work to that server instance and database.

If it doesn't, then you need to look at any error messages - they may help.
It could be a firewall problem, it could be that the remote database is not configured to accept remote connections.
With the info you have given, a more accurate answer if very difficult to give.
 
Share this answer
 
Comments
Mehdi Gholam 24-Sep-11 4:17am    
my 5!
Sumit Kumar Singh India 24-Sep-11 5:22am    
Actually i want to host my site and i want to use database on remote server. no any exception occurs but no data found in database so i think i have to import database but i dont know how?
While connecting to database in a remote server you have to check whether it provides a remote port for connection, if so you have to add the port also to the connection string.

See the example

<add name="ConnectionString" connectionstring="Data Source=[IP/ServerName],[RemotePort];Initial Catalog=[DBName];Persist Security Info=True;User ID=[username];Password=[password]" providername="System.Data.SqlClient" />
 
Share this answer
 
v2
Comments
Sumit Kumar Singh India 24-Sep-11 5:20am    
Actually i want to host my site and i want to use database on remote server.

after settin following same problem(not exception error but no data found in database so i think i have to import database but i dont know how?)
<add name="ConnectionString" connectionstring="Data Source=[IP/ServerName],[RemotePort];Initial Catalog=[DBName];Persist Security Info=True;User ID=[username];Password=[password]" providername="System.Data.SqlClient">
Sumit Kumar Singh India 24-Sep-11 5:21am    
<add name="ConnectionString" connectionstring="Data Source=[IP/ServerName],[RemotePort];Initial Catalog=[DBName];Persist Security Info=True;User ID=[username];Password=[password]" providername="System.Data.SqlClient">
OriginalGriff 24-Sep-11 7:02am    
If you aren't getting an error of any form, then it is likely that the database contains no data - you don't have to attach it if SQL server knows where it is.
Sumit Kumar Singh India 29-Nov-11 5:07am    
thanks you so much!!!!
Prasanth S 24-Sep-11 10:38am    
Use SQL Server Management Studio, go to tasks, choose script database, then choose option include data and schema, now you can generate the query containing data and schema. Run that query for remote database. The other option is to create all the tables and choose import option to import local data to remote database

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900