RE: Connet to SQL Server?
From: Welles (Welles_at_discussions.microsoft.com)
Date: 09/29/04
- Next message: William \(Bill\) Vaughn: "Re: Connet to SQL Server?"
- Previous message: Smartikat: "Re: Remote SQL Server Insert (Speed issue)"
- In reply to: Cowboy (Gregory A. Beamer) - MVP: "RE: Connet to SQL Server?"
- Next in thread: William \(Bill\) Vaughn: "Re: Connet to SQL Server?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Sep 2004 15:51:01 -0700
Just wondering, what exactly are the two authentication modes and how are
they different? Thanks!
"Cowboy (Gregory A. Beamer) - MVP" wrote:
> Mixed mode security works wonders. Good catch!
>
>
> ---
>
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
> "Welles" wrote:
>
> > I just figured out the problem... and the way to solve it is to go to
> > Enterprise Manager, select server properties and on the Security tab change
> > Authentication mode to 'SQL Server and Windows'.
> >
> >
> > "Welles" wrote:
> >
> > > I am a newbie to both .Net and Sql Server and I am trying to access the
> > > database by using the ADO.Net data reader. This is actually one of the
> > > execises in a book that I am reading. However, when I run this program, there
> > > is an error saying that "Login failed for user 'sa'. Reason: Not associated
> > > with a trusted SQL Server connection." Are there some settings I have to
> > > change in the Sql Server? Please help me!
> > >
> > > //--------------------------------------------------------------
> > > using System;
> > > using System.Data;
> > > using System.Data.SqlClient;
> > >
> > > class MyApp
> > > {
> > > static void Main()
> > > {
> > > try{
> > > SqlConnection conn = new
> > > SqlConnection("server=localhost;uid=sa;pwd=;database=pubs");
> > > conn.Open();
> > >
> > > SqlCommand comm = new SqlCommand("select * from titles", conn);
> > > SqlDataReader reader = comm.ExecuteReader();
> > >
> > > while(reader.Read())
> > > Console.WriteLine(reader.GetString(1));
> > >
> > > conn.Close();
> > > }
> > >
> > > catch(Exception e){
> > > Console.WriteLine(e.Message);
> > > }
> > > }
> > > }
> > >
> > > //--------------------------------------------------------------
- Next message: William \(Bill\) Vaughn: "Re: Connet to SQL Server?"
- Previous message: Smartikat: "Re: Remote SQL Server Insert (Speed issue)"
- In reply to: Cowboy (Gregory A. Beamer) - MVP: "RE: Connet to SQL Server?"
- Next in thread: William \(Bill\) Vaughn: "Re: Connet to SQL Server?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|