944,160 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 6600
  • C# RSS
Jun 1st, 2006
0

Remote Database server error.

Expand Post »
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
"
Last edited by alc6379; Jun 2nd, 2006 at 12:08 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Aubrey is offline Offline
2 posts
since Jun 2006
Jun 2nd, 2006
0

Re: Remote Database server error.

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.
Team Colleague
Reputation Points: 186
Solved Threads: 147
Cookie... That's it
alc6379 is offline Offline
2,519 posts
since Dec 2003
Jun 2nd, 2006
0

Re: Remote Database server error.

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
C# Syntax (Toggle Plain Text)
  1. string connectionString=
  2. @"Data Source=srvername or ip" +
  3. @";Initial Catalog=database" +
  4. @";User Id=username" +
  5. @";Password=passwrd";
Reputation Points: 23
Solved Threads: 16
Posting Whiz in Training
plazmo is offline Offline
206 posts
since Aug 2005
Jun 2nd, 2006
0

Re: Remote Database server error.

Ok i will take the user id and password out, but where do i put them if they requires the userid and password.

I use enterprise manager to access to my database at the server.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Aubrey is offline Offline
2 posts
since Jun 2006
Jun 2nd, 2006
0

Re: Remote Database server error.

no dont take out the username and password.
just take out "Trusted_Connection=yes;";"

and use the connection string i showed you
UID is now User Id
PWD is now Password
etc...
Reputation Points: 23
Solved Threads: 16
Posting Whiz in Training
plazmo is offline Offline
206 posts
since Aug 2005
Jun 3rd, 2006
0

Re: Remote Database server error.

SQL Connections string
Network Library=DBMSSOCN;Data Source=192.168.90.10,1433;database=Northwind;User id=;Password=;
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: How to connect MS SQL server 2000 with C#
Next Thread in C# Forum Timeline: Blogs About C# or .net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC