Remote Database server error.

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2006
Posts: 2
Reputation: Aubrey is an unknown quantity at this point 
Solved Threads: 0
Aubrey Aubrey is offline Offline
Newbie Poster

Remote Database server error.

 
0
  #1
Jun 1st, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Remote Database server error.

 
0
  #2
Jun 2nd, 2006
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.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Remote Database server error.

 
0
  #3
Jun 2nd, 2006
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
  1. string connectionString=
  2. @"Data Source=srvername or ip" +
  3. @";Initial Catalog=database" +
  4. @";User Id=username" +
  5. @";Password=passwrd";
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 2
Reputation: Aubrey is an unknown quantity at this point 
Solved Threads: 0
Aubrey Aubrey is offline Offline
Newbie Poster

Re: Remote Database server error.

 
0
  #4
Jun 2nd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Remote Database server error.

 
0
  #5
Jun 2nd, 2006
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...
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 27
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Remote Database server error.

 
0
  #6
Jun 3rd, 2006
SQL Connections string
Network Library=DBMSSOCN;Data Source=192.168.90.10,1433;database=Northwind;User id=;Password=;
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC