| | |
Remote Database server error.
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 2
Reputation:
Solved Threads: 0
Hello anyone :cheesy: ,
I am really new in programming with C# and know very little about it. Currently i am doing a asp website for my company as i am on a school attechment. No one here can help me. I am suspose to do a helpDesk website for my company and i am stuck at the log in page already.
I am suspose to connect to a remote PC(server) MSSql7 Database within the same LAN but i cant make my codes work as they kept giving me this error
"An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
I really do not know where go wrong, could it be my connectionString?
"conn.ConnectionString = "Data Source=192.168.90.10;Initial Catalog=HD_test;UID=username changed;PWD=password changed;Trusted_Connection=yes;";
Aubrey
Cheers =D
"
I am really new in programming with C# and know very little about it. Currently i am doing a asp website for my company as i am on a school attechment. No one here can help me. I am suspose to do a helpDesk website for my company and i am stuck at the log in page already.
I am suspose to connect to a remote PC(server) MSSql7 Database within the same LAN but i cant make my codes work as they kept giving me this error
"An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
I really do not know where go wrong, could it be my connectionString?
"conn.ConnectionString = "Data Source=192.168.90.10;Initial Catalog=HD_test;UID=username changed;PWD=password changed;Trusted_Connection=yes;";
Aubrey
Cheers =D
"
Last edited by alc6379; Jun 2nd, 2006 at 12:08 am.
Hi there,
Just for future reference, please make sure your connection string doesn't contain sensitive information like usernames and passwords. I took the liberty of editing out the user name and password from the string.
But, given your issue, it doesn't sound like permissions are set properly on your database server. As such, that's not so much of a C# issue, but more of a server configuration issue.
Looking at the connection string, though, what database server are you using for your backend? I know on SQL Server, you use "User ID=foo;Password=bar" in your connection string, rather than "UID=foo;PWD=bar". It could be different depending on the type of database. Like, an ODBC connection string might be different from a SQL connection string. Since you mentioned MSSQL server, you might just need to change that.
Just for future reference, please make sure your connection string doesn't contain sensitive information like usernames and passwords. I took the liberty of editing out the user name and password from the string.
But, given your issue, it doesn't sound like permissions are set properly on your database server. As such, that's not so much of a C# issue, but more of a server configuration issue.
Looking at the connection string, though, what database server are you using for your backend? I know on SQL Server, you use "User ID=foo;Password=bar" in your connection string, rather than "UID=foo;PWD=bar". It could be different depending on the type of database. Like, an ODBC connection string might be different from a SQL connection string. Since you mentioned MSSQL server, you might just need to change that.
Alex Cavnar, aka alc6379
try getting rid of the Trusted_Connection that has always led me to problems when logging in without intergrated security.
And try the newer format for the connection string, below is the one i ripped quick out of one old sites which worked
And try the newer format for the connection string, below is the one i ripped quick out of one old sites which worked
C# Syntax (Toggle Plain Text)
string connectionString= @"Data Source=srvername or ip" + @";Initial Catalog=database" + @";User Id=username" + @";Password=passwrd";
![]() |
Similar Threads
- Problem connecting to the database after changing the database server (ASP.NET)
- shortcut on client to connect to remote database filemaker (MS Access and FileMaker Pro)
- struggling with connecting database to server (ASP.NET)
- Database connectioin error (MySQL)
Other Threads in the C# Forum
- Previous Thread: How to connect MS SQL server 2000 with C#
- Next Thread: Blogs About C# or .net
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






