Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Book / SQL connection question
Message
From
06/02/2003 11:01:08
 
 
To
05/02/2003 23:57:54
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00749702
Message ID:
00749908
Views:
40
It sounds like you didn't install your server in Mixed Authentication mode. This means you can only connect to it with NT Authentication. There are two things you can do to fix this...

1. Change your server to be a mixed mode server:

How to set up Mixed Mode security (Enterprise Manager)
To set up Mixed Mode security
Expand a server group.
Right-click a server, and then click Properties.
Click the Security tab.
Under Authentication, click SQL Server and Windows.

2. Change the connection string to use trusted mode, something like this:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=(local)

Then, you have to put the ASPNET user on your machine into the Administrators group. (only do this on a DEV machine).


BOb



>Hi Bonnie -
>
>Sorry -
>
>I am trying to run the C# Winforms Example in the source code just as it was downloaded. (there is only one full app - Simple Windows Application_Csharp)
>
>I just opened the Query Analyzer and CHARLES was not a choice on the dropdown - just (local).
>
>When I tried to log on to (local) with sa (as in the connection string in Kevin's code and what I believe it the default in a new SQL server install) I got the error that this was "Not associated with a trusted SQL Server connection". Changing the option from SQL Server Authentication to Windows Authentication got me in.
>
>Once in, the server is shown as CHARLES(CHARLES\Chaan) (CHARLES is the name of the computer. chaan is the user logged in - full admin rights - WinXP Pro )
>The query window has in the title bar
>"Query - CHARLES.master.CHARLES\Chaan"
>
>Have a feeling the root of my problem lies somewhere in my not being able to use SQL Server Authentication.
>
>How do I establish a trusted SQL Server connection.
>
>TIA
>
>>Charles,
>>
>>If you're trying examples from Kevin's book, why don't you clue us in as to which chapter and which example ...
>>
>>Thanks,
>>~~Bonnie
>>
>>
>>>Hi Kevin -
>>>
>>>Since this came up in the context of trying to run the C# winforms sample in your book I thought this might be a useful place to display my complete ignorance of all things SQL Server:
>>>
>>>I have SQL2000 installed with (I believe) the default settings. The computer name is CHARLES. When I open Enterprise Manager I don't see CHARLES I see local. Can get in to Northwind etc. I have SQLServer loading on OS boot. Service manager shows server as CHARLES.
>>>
>>>I run your C# winforms sample. When I try to launch the Orders form I get
>>>
>>>An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
>>>
>>>Additional information: System error.
>>>
>>>No source code link.
>>>
>>>Left all connection string settings at default in Data.cs
>>>
>>>Then tried changing server to CHARLES in that conneciton string. No joy.
>>>
>>>I'm sure I'm missing something very obvious but with my level of SQL Server knowledge the obvious is obscure.
>>>
>>>Guidance?
>>>
>>>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform