asp.net and conecting to sql server2005

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>
 
J

Juan T. Llibre

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top