ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 25th, 2003, 12:36 PM
Isambella Isambella is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 13 Isambella User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Open connection with SQL server

hello

I use ASP.NET with SQL server 2000, hava a problem when I try to open the connection to my database which is in a sql server 2000


The Error is:
Server Error in '/TrainingSystem' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

Source Error:


Line 24: Private Sub OpenConnection()
Line 25: Cn = New SqlConnection(ConfigurationSettings.AppSettings("OpenDB"))
Line 26: Cn.Open()
Line 27: 'Try
Line 28: ' Cn.Open()

---------------------------------------------------------
I am using ASP.Net with VB script


This code is on the web.config file

<appSettings>
<add key="OpenDB" value="Server=localhost;uid=sa;pwd=;database=TSdatabase;"></add>
<!-- DYNAMIC INTRANET SETTING Set IsIntranet value="true" to insert is Student option in user Administration -->
<add key="isIntranet" value="false"></add>
</appSettings>


On the VB file I have this code:

Public Cn As New SqlConnection()

Private Sub OpenConnection()
Cn = New SqlConnection(ConfigurationSettings.AppSettings("OpenDB"))
Cn.Open()
End Sup

and I call it in the sub Page_Load

Thx

Pls help me
I can not Find the error

Reply With Quote
  #2  
Old March 4th, 2003, 03:05 PM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Reply With Quote
  #3  
Old March 6th, 2003, 12:36 PM
Isambella Isambella is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 13 Isambella User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thx

Thx

I found the error I had check one option to one options in the SQL sercer, to be the user able, to use the server not only the window.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Open connection with SQL server

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap