RE: Connet to SQL Server?

From: Welles (Welles_at_discussions.microsoft.com)
Date: 09/29/04


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);
> > > }
> > > }
> > > }
> > >
> > > //--------------------------------------------------------------



Relevant Pages

  • Re: best practice for inserting rows using a dataAdapter?
    ... "Cowboy (Gregory A. Beamer)" wrote: ... nice perf gain by simply creating strongly typed datasets, ... Dim da As new SqlDataAdapter ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: best practice for inserting rows using a dataAdapter?
    ... "Cowboy (Gregory A. Beamer)" wrote: ... nice perf gain by simply creating strongly typed datasets, ... Dim da As new SqlDataAdapter ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: set Page.IsValid = false;
    ... actually by using server transfer, perhaps because i'm also using ajax, i ... "Cowboy (Gregory A. Beamer)" wrote: ... Cowboy is a name given to me when I moved to Georgia and still wore a cowboy ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: group dataset
    ... "type table" that shows luxury, ... CASE automobile WHEN 'Chevy' THEN 'Standard' ... "Cowboy (Gregory A. Beamer)" wrote: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Recommend Community Software
    ... the other app within your full Sharepoint portal. ... modules that may encompass all the functionality you need. ... "Cowboy (Gregory A. Beamer)" wrote: ...
    (microsoft.public.dotnet.framework.aspnet)

Loading