asp.net and conecting to sql server2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to conenct oto sql server 2005
when i do it i the VS2005 every is ok
but when i run from the browser i get :
The login failed. Login failed for user 'JUSTATHOME\ASPNET'.
i read this :
http://support.microsoft.com/kb/316989
and i wanted the first option to use my own user name and password i did :
<appSettings>
<add value="Data Source=.\SQLEXPRESS;Initial Catalog=DB1;Integrated
Security=True;user id=user1;password=user1;" key="conn"/>
</appSettings>
and tried to use
<connectionStrings>
<add name="localCon" connectionString="Data Source=.\SQLEXPRESS;Integrated
Security=True;uid=user1;pwd=user1;database=DB1"
providerName="System.Data.SqlClient" />

and i still get the error message on the ASPNET user
what can i do withought changing the sql the ASPNET user permissions
thnaks i nadvance
peleg
<add name="BoCon" connectionString="Data Source=localhost;Integrated
Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
 
1. Change the way SQL Server Express 2005 authenticates from "Windows"
to "Mixed Authentication", if you want to use SQL Server logins.

2. Get rid of Integrated Security=True; :

Instead of :
<add value="Data Source=.\SQLEXPRESS;Initial Catalog=DB1;Integrated
Security=True;user id=user1;password=user1;" key="conn"/>

....use :
<add value="Data Source=.\SQLEXPRESS;Initial Catalog=DB1;user id=user1;password=user1;" key="conn"/>

The same for your other connection string.

If you use Integrated Security, you don't need to use a specific user.

You could, also, get rid of "user id=user1;password=user1;",
make sure SQL Express is using Windows authentication,
and create a SQL login for JUSTATHOME\ASPNET.

Your choice, depending on how you want to handle this.

If you haven't downloaded SQL Management Studio Express, install it :
http://www.microsoft.com/downloads/...AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

It makes managing SQL Server Express 2055 a whole lot easier.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Thanksalot
i wil ltest it
peleg

Juan T. Llibre said:
1. Change the way SQL Server Express 2005 authenticates from "Windows"
to "Mixed Authentication", if you want to use SQL Server logins.

2. Get rid of Integrated Security=True; :

Instead of :
<add value="Data Source=.\SQLEXPRESS;Initial Catalog=DB1;Integrated
Security=True;user id=user1;password=user1;" key="conn"/>

....use :
<add value="Data Source=.\SQLEXPRESS;Initial Catalog=DB1;user id=user1;password=user1;" key="conn"/>

The same for your other connection string.

If you use Integrated Security, you don't need to use a specific user.

You could, also, get rid of "user id=user1;password=user1;",
make sure SQL Express is using Windows authentication,
and create a SQL login for JUSTATHOME\ASPNET.

Your choice, depending on how you want to handle this.

If you haven't downloaded SQL Management Studio Express, install it :
http://www.microsoft.com/downloads/...AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

It makes managing SQL Server Express 2055 a whole lot easier.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top