HELP - HELP - HELP

G

Guest

Vey simple, but does not work:

I'm trying to set a data-driven Web page with a GridView control. The steps
I followed are:

1. Created a data connection using Database Explorer.
2. Dropped an SqlDataSource and a GridView control on the page.
3. Set the data source (configured by using the data connection) and
selected the this data source for the GridView.
4. Specified the columns of a table for the GridView.
5. Ran test successfully.

But, when I try to view the page on the browser, the following exception is
thrown:

System.Data.SqlClient.SqlException: Cannot open database "Test" requested by
the login. The login failed. Login failed for user 'EP_WKS302\ASPNET'.
** (EP_WKS302 is the computer name).

I'm using the Express Editions of Visual Web Developer 2005 and SQL Server
2005. The authentication mode for the SQL Server is "Windows Authentication".
The Web.Config file has the following connection string:
........................................................................................................................
<connectionStrings>
<add name="TestConnectionString" connectionString="Data
Source=EP_WKS302\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
.......................................................................................................................

Does anybody can help?
 
W

William Buchanan

When you run a web application, it doesn't run under the currently logged in
user. Instead, it runs under a special user account, in your case
'EP_WKS302\ASPNET'.

So, what you need to do is add a user to your database (doesn't matter what
name you give it), give it the correct permissions (just give it full
permissions to get going), then include the user name and password in the
connection string (which will probably be in your Web.config file.

Will
 
E

Eliyahu Goldin

Alternatively you can add 'EP_WKS302\ASPNET' logon to the database server.

Eliyahu
 
G

Guest

I'll try it, but does that mean I should use SQL Server authentication mode
(since Windows authentication does not work)? I couldn't find instructions in
Visual Web Developer Guided Tour material...
 
E

Eliyahu Goldin

If you add a logon for 'EP_WKS302\ASPNET' or whatever other account you run
the application under, you can use Windows authentication.

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top