HELP - HELP - HELP

Discussion in 'ASP .Net' started by =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006.

  1. 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?
     
    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006
    #1
    1. Advertising

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


    "Kimon Ifantidis" <> wrote in
    message news:...
    > 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?
     
    William Buchanan, Mar 9, 2006
    #2
    1. Advertising

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

    Eliyahu

    "William Buchanan" <> wrote in message
    news:%...
    > 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
    >
    >
    > "Kimon Ifantidis" <> wrote in
    > message news:...
    >> 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?

    >
    >
     
    Eliyahu Goldin, Mar 9, 2006
    #3
  4. 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...



    "William Buchanan" wrote:

    > 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
    >
    >
    > "Kimon Ifantidis" <> wrote in
    > message news:...
    > > 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?

    >
    >
    >
     
    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006
    #4
  5. If you add a logon for 'EP_WKS302\ASPNET' or whatever other account you run
    the application under, you can use Windows authentication.

    Eliyahu

    "Kimon Ifantidis" <> wrote in
    message news:...
    > 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...
    >
    >
    >
    > "William Buchanan" wrote:
    >
    >> 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
    >>
    >>
    >> "Kimon Ifantidis" <> wrote in
    >> message news:...
    >> > 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?

    >>
    >>
    >>
     
    Eliyahu Goldin, Mar 9, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    816
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    795
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    903
    Daniel
    Jul 16, 2004
  4. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    508
    Saager
    Oct 30, 2003
  5. Usman

    HELP HELP HELP

    Usman, Jan 22, 2004, in forum: C++
    Replies:
    7
    Views:
    320
    Usman
    Jan 23, 2004
Loading...

Share This Page