Re: Connection string does not work from asp.net web application by Jeff
Jeff
Sun Nov 14 22:41:58 CST 2004
You mentioned the ASPNET account, I mentioned that he's connecting via
Standard SQL auth, it appears.
Jeff
"Val Mazur" <group51a@hotmail.com> wrote in message
news:u5dSXtsyEHA.2600@TK2MSFTNGP09.phx.gbl...
> Do you want to say that passing user and password in a connection string
is
> not allowed?
>
> --
> Val Mazur
> Microsoft MVP
>
>
> <jeff@removeemergencyreporting.com> wrote in message
> news:OloothcyEHA.3808@tk2msftngp13.phx.gbl...
> > No, he's passing in the username and password in the connection string.
> >
> > What happens if you drop a DataAdapter on the form, and go through the
> > Wizard? You can then view the connection string created
> >
> > Jeff
> >
> > "Val Mazur" <group51a@hotmail.com> wrote in message
> > news:OQhmrkbyEHA.3024@TK2MSFTNGP14.phx.gbl...
> >> Hi,
> >>
> >> It means that most likely you do not have permissions for ASPNET
account
> > to
> >> access SQL Server database. Check if your ASPNET account exists in a
list
> > of
> >> the users for login in a SQL Server database. You would also need to
> >> grant
> >> permissions for ASPNET account to run specific SPs or access specific
> > tables
> >>
> >> --
> >> Val Mazur
> >> Microsoft MVP
> >>
> >>
> >> "Clay" <Clay@discussions.microsoft.com> wrote in message
> >> news:47191814-F4A9-407B-BA04-45B9E50B9BE2@microsoft.com...
> >> >
> >> > If I run the following code on my development machine as a "Windows
> >> > Application", it works. If I run the following code on my
development
> >> > machine as an "ASP.NET Web Application", I get the error "SQL Server
> > does
> >> > not
> >> > exist or access denied." when trying to open the connection. I would
> >> > appreciate any assistance in determining why.
> >> >
> >> > Private Sub TestAdo()
> >> > Dim conn As New System.Data.SqlClient.SqlConnection
> >> > Dim cmd As New System.Data.SqlClient.SqlCommand
> >> > Dim dr As System.Data.SqlClient.SqlDataReader
> >> > conn.ConnectionString = "Data
> >> > Source=np:SQLSERVER1;uid=username;pwd=password;Initial
> >> > Catalog=STARMT;Connection Timeout=5;"
> >> > conn.Open()
> >> > cmd.Connection = conn
> >> > cmd.CommandText = "select * from customers"
> >> > dr = cmd.ExecuteReader()
> >> > Do While dr.Read
> >> > '
> >> > Loop
> >> > dr.Close()
> >> > conn.Close()
> >> > End Sub
> >> >
> >> >
> >> > Thanks in advance.
> >> >
> >> > Clay
> >> >
> >>
> >>
> >
> >
>
>