| | |
Connection to remote SQL Database problem in app
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello guys!
I am developing simple desktop application that suppose to connect to SQL DB launched on remote server.
Everything going fine, exept that when connecting to DB I get exeption "Login failed for user 'guest'."
So, looks like i need to create some user with password and give him at least 'read rights'. How can I do it.
What I tried:
1. 'sa' name doesn't work.
2. Allow remote connection - enabled.
I am developing simple desktop application that suppose to connect to SQL DB launched on remote server.
Everything going fine, exept that when connecting to DB I get exeption "Login failed for user 'guest'."
So, looks like i need to create some user with password and give him at least 'read rights'. How can I do it.
What I tried:
1. 'sa' name doesn't work.
2. Allow remote connection - enabled.
C# Syntax (Toggle Plain Text)
SqlConnection sqlconn = new SqlConnection("Data Source=64.191.121.53,1433;Network Library=DBMSSOCN;Initial Catalog=remoteDB;User ID=guest;Password=;");
0
#3 Oct 19th, 2009
You also need to set "Integrated Security=False;" when using a username/password connection string. Here are example connection string builders:
C# Syntax (Toggle Plain Text)
public static string BuildSqlNativeConnStr(string server, string database) { return string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", server, database); } public static string BuildSqlNativeConnStr(string server, string database, string username, string password) { return string.Format("Data Source={0};Initial Catalog={1};Integrated Security=False;User Id={2};Password={3};", server, database, username, password); }
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#4 Oct 19th, 2009
Hello again. thanks for reply. Can you please advise me step by step how to create such db i need.
I made this:
1. Created db in SQL 2008 Express
2. Created an empty table (ID,Name...there will be no any use of it)
3. In Object Explore > Security > Credentials created new credential with Username Password.
4. In Object Explore > Logins created new login and password with the same logs and passes as my new credential.
5. Saved database.
6. From Microsoft SQL Server > MSSQL.1>MSSQL>DATA copied RemoteDB.mdf on the desctop and that after sent this file by FTP into remote webserver. Placed him in root.
7. In my program changed connection string as sknake has adviced.
8. tried to connect. Alas, the same problem cannot connect and throws me MessageBox (exeption) "Login failed for user 'NathanBase'."
Where have I went wrong?
I made this:
1. Created db in SQL 2008 Express
2. Created an empty table (ID,Name...there will be no any use of it)
3. In Object Explore > Security > Credentials created new credential with Username Password.
4. In Object Explore > Logins created new login and password with the same logs and passes as my new credential.
5. Saved database.
6. From Microsoft SQL Server > MSSQL.1>MSSQL>DATA copied RemoteDB.mdf on the desctop and that after sent this file by FTP into remote webserver. Placed him in root.
7. In my program changed connection string as sknake has adviced.
8. tried to connect. Alas, the same problem cannot connect and throws me MessageBox (exeption) "Login failed for user 'NathanBase'."
Where have I went wrong?
Last edited by Nfurman; Oct 19th, 2009 at 5:04 pm.
![]() |
Similar Threads
- Remote MS SQL database update issue (MS SQL)
- synchronization of local database with remote server database (ASP.NET)
- Remote sql database (ASP.NET)
- SQL Database Problem (C#)
- PLEASE HELP!....SQL Database problem.... (C#)
- built in login and createuser wizard but for a remote SQL database? how to change? (ASP.NET)
- direct remote sql connection (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: How to put New record at the end of Database Table
- Next Thread: Looking for a team of junior C# .NET programmers
| Thread Tools | Search this Thread |
Tag cloud for app, c#, connection, remote, sql
.net access ado.net ajax app apple applicatio application array asp asp.net c# c++ casting chat combobox connection control copilot data database datetime dbconnection delphi derby deserialized developer development drawing dropdown editor enabled execution file foreach forloop form forms gdi+ google httpwebrequest image index iphone java javascript jsp linux list listbox login math microsoft ms msdn mssqlserver2005 mssqlserverandasp mysql news number office operator oracle photoshop php picturebox post programming query read record remote remoting report resource richtextbox saving script security server software sql sql-server sqlserver ssh string tables text textbox treeview update vb.net video view vista web webbrowser windows winforms wpf







