Separate Webserver and SQL Server -- error when connecting asp.netapp to a database

Discussion in 'ASP .Net' started by Ann Marinas, Apr 10, 2005.

  1. Ann Marinas

    Ann Marinas Guest

    Hi all,

    I would like to ask for some help regarding separating the asp.net
    webserver and the sql server.

    I have created an asp.net application for a certain company. Initially,
    we installed both the iis and sql server in a single machine. Not too
    long ago, the machine had some hardware problems, and management has
    decided to purchase new servers, for both asp.net and sql server.

    Once we installed my webapp on the first server and the sql server on
    another, we have encountered some errors with it. Basically, the
    exception that keeps on saying was:

    "SQL Server database does not exist or access denied."

    Tried creating a windows account for the webapp to use to connect and
    configure it to the sql server, but it does not work.

    Tried also connecting with the database using a SQL Server account, but
    to no avail.

    Please help! I would really appreciate it!!


    Regards,
    Ann Marinas
     
    Ann Marinas, Apr 10, 2005
    #1
    1. Advertising

  2. Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    An ASP.NET application typically connects to the database through a
    System.Data.SqlClient.SqlConnection object.
    To change the SQL server, you need to find all SqlConnection objects and
    update their ConnectionString property to point to the new database
    server.

    Greetings,
    Wessel

    -----Original Message-----
    From: Ann Marinas [mailto:]
    Posted At: Sunday, April 10, 2005 12:11 PM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: Separate Webserver and SQL Server -- error when connecting
    asp.net app to a database
    Subject: Separate Webserver and SQL Server -- error when connecting
    asp.net app to a database

    Hi all,

    I would like to ask for some help regarding separating the asp.net
    webserver and the sql server.

    I have created an asp.net application for a certain company. Initially,
    we installed both the iis and sql server in a single machine. Not too
    long ago, the machine had some hardware problems, and management has
    decided to purchase new servers, for both asp.net and sql server.

    Once we installed my webapp on the first server and the sql server on
    another, we have encountered some errors with it. Basically, the
    exception that keeps on saying was:

    "SQL Server database does not exist or access denied."

    Tried creating a windows account for the webapp to use to connect and
    configure it to the sql server, but it does not work.

    Tried also connecting with the database using a SQL Server account, but
    to no avail.

    Please help! I would really appreciate it!!


    Regards,
    Ann Marinas
     
    Wessel Troost, Apr 10, 2005
    #2
    1. Advertising

  3. Ann Marinas

    Mark Rae Guest

    Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    "Ann Marinas" <> wrote in message
    news:...

    > Please help! I would really appreciate it!!


    1) Are you using the native .NET data provider, OleDb or (surely not!) ODBC?

    2) What ConnectionString are you using?

    3) When you installed SQL Server, what authentication mode did you choose
    (SQL Server, Windows or mixed)?

    4) On the SQL Server machine, launch SQL Query Analyzer (NOT ENTERPRISE
    MANAGER!) and try to log in using the UserID and password from the
    ConnectionString in 2) above - can you? If so, can you drop the database
    dropdown and select the database from the ConnectionString in 2) above? If
    so, run SELECT * FROM sysobjects - what do you see?
     
    Mark Rae, Apr 10, 2005
    #3
  4. Ann Marinas

    Ann Marinas Guest

    Hi, Wessel!

    Thank you for your reply.

    I've changed my connectionstring property after the database was
    transfered to another server and it has got all the correct values, but
    still no avail.

    Thanks again for helping me out! Really do appreciate it!

    Cheers,
    Ann

    Wessel Troost wrote:
    > An ASP.NET application typically connects to the database through a
    > System.Data.SqlClient.SqlConnection object.
    > To change the SQL server, you need to find all SqlConnection objects and
    > update their ConnectionString property to point to the new database
    > server.
    >
    > Greetings,
    > Wessel
    >
    > -----Original Message-----
    > From: Ann Marinas [mailto:]
    > Posted At: Sunday, April 10, 2005 12:11 PM
    > Posted To: microsoft.public.dotnet.framework.aspnet
    > Conversation: Separate Webserver and SQL Server -- error when connecting
    > asp.net app to a database
    > Subject: Separate Webserver and SQL Server -- error when connecting
    > asp.net app to a database
    >
    > Hi all,
    >
    > I would like to ask for some help regarding separating the asp.net
    > webserver and the sql server.
    >
    > I have created an asp.net application for a certain company. Initially,
    > we installed both the iis and sql server in a single machine. Not too
    > long ago, the machine had some hardware problems, and management has
    > decided to purchase new servers, for both asp.net and sql server.
    >
    > Once we installed my webapp on the first server and the sql server on
    > another, we have encountered some errors with it. Basically, the
    > exception that keeps on saying was:
    >
    > "SQL Server database does not exist or access denied."
    >
    > Tried creating a windows account for the webapp to use to connect and
    > configure it to the sql server, but it does not work.
    >
    > Tried also connecting with the database using a SQL Server account, but
    > to no avail.
    >
    > Please help! I would really appreciate it!!
    >
    >
    > Regards,
    > Ann Marinas
    >
     
    Ann Marinas, Apr 10, 2005
    #4
  5. Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    - Post the connection string, we might be able to help.
    - "telnet sqlserver 1433" to see if you can reach the SQL server. 1433
    is the default SQL server port.
    - Check the firewall settings on the SQL Server.
    - Check if the SQL Server user has a default database, and if the user
    is valid in that database.

    Greetings,
    Wessel

    -----Original Message-----
    From: Ann Marinas [mailto:]
    Posted At: Sunday, April 10, 2005 12:55 PM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: Separate Webserver and SQL Server -- error when connecting
    asp.net app to a database
    Subject: Re: Separate Webserver and SQL Server -- error when connecting
    asp.net app to a database

    Hi, Wessel!

    Thank you for your reply.

    I've changed my connectionstring property after the database was
    transfered to another server and it has got all the correct values, but
    still no avail.

    Thanks again for helping me out! Really do appreciate it!

    Cheers,
    Ann

    Wessel Troost wrote:
    > An ASP.NET application typically connects to the database through a
    > System.Data.SqlClient.SqlConnection object.
    > To change the SQL server, you need to find all SqlConnection objects

    and
    > update their ConnectionString property to point to the new database
    > server.
    >
    > Greetings,
    > Wessel
    >
    > -----Original Message-----
    > From: Ann Marinas [mailto:]
    > Posted At: Sunday, April 10, 2005 12:11 PM
    > Posted To: microsoft.public.dotnet.framework.aspnet
    > Conversation: Separate Webserver and SQL Server -- error when

    connecting
    > asp.net app to a database
    > Subject: Separate Webserver and SQL Server -- error when connecting
    > asp.net app to a database
    >
    > Hi all,
    >
    > I would like to ask for some help regarding separating the asp.net
    > webserver and the sql server.
    >
    > I have created an asp.net application for a certain company.

    Initially,
    > we installed both the iis and sql server in a single machine. Not too
    > long ago, the machine had some hardware problems, and management has
    > decided to purchase new servers, for both asp.net and sql server.
    >
    > Once we installed my webapp on the first server and the sql server on
    > another, we have encountered some errors with it. Basically, the
    > exception that keeps on saying was:
    >
    > "SQL Server database does not exist or access denied."
    >
    > Tried creating a windows account for the webapp to use to connect and
    > configure it to the sql server, but it does not work.
    >
    > Tried also connecting with the database using a SQL Server account,

    but
    > to no avail.
    >
    > Please help! I would really appreciate it!!
    >
    >
    > Regards,
    > Ann Marinas
    >
     
    Wessel Troost, Apr 10, 2005
    #5
  6. Ann Marinas

    Ann Marinas Guest

    Hi, Mark!

    Thank you for helping me out.

    1) I am using System.Data.SqlClient for my data access.
    2) I have changed the connection string which was located in my
    web.config file when we separated the webserver to the sql db server
    3) The authenticatio is set to Mixed mode -- SQL Server and Windows
    Authentication
    4) On the Webserver, the Query Analyzer is not installed on the
    webserver. However if I am going to access the query analyzer, I have to
    access the sql server itself.

    Thanks again!



    Mark Rae wrote:
    > "Ann Marinas" <> wrote in message
    > news:...
    >
    >
    >>Please help! I would really appreciate it!!

    >
    >
    > 1) Are you using the native .NET data provider, OleDb or (surely not!) ODBC?
    >
    > 2) What ConnectionString are you using?
    >
    > 3) When you installed SQL Server, what authentication mode did you choose
    > (SQL Server, Windows or mixed)?
    >
    > 4) On the SQL Server machine, launch SQL Query Analyzer (NOT ENTERPRISE
    > MANAGER!) and try to log in using the UserID and password from the
    > ConnectionString in 2) above - can you? If so, can you drop the database
    > dropdown and select the database from the ConnectionString in 2) above? If
    > so, run SELECT * FROM sysobjects - what do you see?
    >
    >
     
    Ann Marinas, Apr 10, 2005
    #6
  7. Ann Marinas

    Mark Rae Guest

    Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    "Ann Marinas" <> wrote in message
    news:...

    Ann,

    > 1) I am using System.Data.SqlClient for my data access.


    That's a good thing.

    > 2) I have changed the connection string which was located in my web.config
    > file when we separated the webserver to the sql db server


    I'm sure you have but, if we're going to help you, you're going to have to
    tell us what the ConnectionString is... :)

    > 3) The authenticatio is set to Mixed mode -- SQL Server and Windows
    > Authentication


    Even easier.

    > 4) On the Webserver, the Query Analyzer is not installed on the webserver.
    > However if I am going to access the query analyzer, I have to access the
    > sql server itself.


    No - just use any machine which can "see" the SQL Server and which has the
    SQL Client Tools installed.
     
    Mark Rae, Apr 10, 2005
    #7
  8. Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    Ann,

    You are getting an error in accessing database. This means that server
    connections is ok, just database is not accessible. Most likely you have to
    have another look into permissions for the login you are connecting under
    for the database you are connecting to. Or make sure the database name is
    correct.

    Eliyahu

    "Ann Marinas" <> wrote in message
    news:...
    > Hi all,
    >
    > I would like to ask for some help regarding separating the asp.net
    > webserver and the sql server.
    >
    > I have created an asp.net application for a certain company. Initially,
    > we installed both the iis and sql server in a single machine. Not too
    > long ago, the machine had some hardware problems, and management has
    > decided to purchase new servers, for both asp.net and sql server.
    >
    > Once we installed my webapp on the first server and the sql server on
    > another, we have encountered some errors with it. Basically, the
    > exception that keeps on saying was:
    >
    > "SQL Server database does not exist or access denied."
    >
    > Tried creating a windows account for the webapp to use to connect and
    > configure it to the sql server, but it does not work.
    >
    > Tried also connecting with the database using a SQL Server account, but
    > to no avail.
    >
    > Please help! I would really appreciate it!!
    >
    >
    > Regards,
    > Ann Marinas
     
    Eliyahu Goldin, Apr 10, 2005
    #8
  9. Re: Separate Webserver and SQL Server -- error when connecting asp

    the connection string is:

    Data Provider=myDB; Initial Catalog=myDBName; Integrated Securit=SSPI

    tried doing the telnet, and it says:
    Connecting To database...Could not open a connection to host on port 1433 :
    Connect failed


    Really do appreciate your help!

    "Wessel Troost" wrote:

    > - Post the connection string, we might be able to help.
    > - "telnet sqlserver 1433" to see if you can reach the SQL server. 1433
    > is the default SQL server port.
    > - Check the firewall settings on the SQL Server.
    > - Check if the SQL Server user has a default database, and if the user
    > is valid in that database.
    >
    > Greetings,
    > Wessel
    >
    > -----Original Message-----
    > From: Ann Marinas [mailto:]
    > Posted At: Sunday, April 10, 2005 12:55 PM
    > Posted To: microsoft.public.dotnet.framework.aspnet
    > Conversation: Separate Webserver and SQL Server -- error when connecting
    > asp.net app to a database
    > Subject: Re: Separate Webserver and SQL Server -- error when connecting
    > asp.net app to a database
    >
    > Hi, Wessel!
    >
    > Thank you for your reply.
    >
    > I've changed my connectionstring property after the database was
    > transfered to another server and it has got all the correct values, but
    > still no avail.
    >
    > Thanks again for helping me out! Really do appreciate it!
    >
    > Cheers,
    > Ann
    >
    > Wessel Troost wrote:
    > > An ASP.NET application typically connects to the database through a
    > > System.Data.SqlClient.SqlConnection object.
    > > To change the SQL server, you need to find all SqlConnection objects

    > and
    > > update their ConnectionString property to point to the new database
    > > server.
    > >
    > > Greetings,
    > > Wessel
    > >
    > > -----Original Message-----
    > > From: Ann Marinas [mailto:]
    > > Posted At: Sunday, April 10, 2005 12:11 PM
    > > Posted To: microsoft.public.dotnet.framework.aspnet
    > > Conversation: Separate Webserver and SQL Server -- error when

    > connecting
    > > asp.net app to a database
    > > Subject: Separate Webserver and SQL Server -- error when connecting
    > > asp.net app to a database
    > >
    > > Hi all,
    > >
    > > I would like to ask for some help regarding separating the asp.net
    > > webserver and the sql server.
    > >
    > > I have created an asp.net application for a certain company.

    > Initially,
    > > we installed both the iis and sql server in a single machine. Not too
    > > long ago, the machine had some hardware problems, and management has
    > > decided to purchase new servers, for both asp.net and sql server.
    > >
    > > Once we installed my webapp on the first server and the sql server on
    > > another, we have encountered some errors with it. Basically, the
    > > exception that keeps on saying was:
    > >
    > > "SQL Server database does not exist or access denied."
    > >
    > > Tried creating a windows account for the webapp to use to connect and
    > > configure it to the sql server, but it does not work.
    > >
    > > Tried also connecting with the database using a SQL Server account,

    > but
    > > to no avail.
    > >
    > > Please help! I would really appreciate it!!
    > >
    > >
    > > Regards,
    > > Ann Marinas
    > >

    >
    >
     
    =?Utf-8?B?QW5uIE1hcmluYXM=?=, Apr 10, 2005
    #9
  10. Re: Separate Webserver and SQL Server -- error when connecting asp

    Hi, Eliyahu!

    I've checked the name of the database and the windows user access name that
    will be used for the database connection. Before I did that, I've double-
    checked as well the user account that will be used to impersonate the access
    if it has permissions on the SQL Server database, but to no avail.

    It keeps on saying that the db is not existing or access is denied -- in
    which I could clearly see the database on the database folder.

    Thanks for helping me out! Really appreciate it! :)
    "Eliyahu Goldin" wrote:

    > Ann,
    >
    > You are getting an error in accessing database. This means that server
    > connections is ok, just database is not accessible. Most likely you have to
    > have another look into permissions for the login you are connecting under
    > for the database you are connecting to. Or make sure the database name is
    > correct.
    >
    > Eliyahu
    >
    > "Ann Marinas" <> wrote in message
    > news:...
    > > Hi all,
    > >
    > > I would like to ask for some help regarding separating the asp.net
    > > webserver and the sql server.
    > >
    > > I have created an asp.net application for a certain company. Initially,
    > > we installed both the iis and sql server in a single machine. Not too
    > > long ago, the machine had some hardware problems, and management has
    > > decided to purchase new servers, for both asp.net and sql server.
    > >
    > > Once we installed my webapp on the first server and the sql server on
    > > another, we have encountered some errors with it. Basically, the
    > > exception that keeps on saying was:
    > >
    > > "SQL Server database does not exist or access denied."
    > >
    > > Tried creating a windows account for the webapp to use to connect and
    > > configure it to the sql server, but it does not work.
    > >
    > > Tried also connecting with the database using a SQL Server account, but
    > > to no avail.
    > >
    > > Please help! I would really appreciate it!!
    > >
    > >
    > > Regards,
    > > Ann Marinas

    >
    >
    >
     
    =?Utf-8?B?QW5uIE1hcmluYXM=?=, Apr 11, 2005
    #10
  11. Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    Hi Ann,

    Looks like there's more than one issue. I think a connection string for
    SQL server looks like this:

    data source=...;user id=...;password=...;initial catalog=...;

    The data provider is the driver that serves your database, not the
    database.

    Below this, on the network layer, there's no chance your connection is
    going to work if you can't connect to the database server on port 1433.

    Greetings,
    Wessel

    -----Original Message-----
    From: Ann Marinas [mailto:Ann ]
    Posted At: Sunday, April 10, 2005 11:15 PM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: Separate Webserver and SQL Server -- error when connecting
    asp.net app to a database
    Subject: Re: Separate Webserver and SQL Server -- error when connecting
    asp

    the connection string is:

    Data Provider=myDB; Initial Catalog=myDBName; Integrated Securit=SSPI

    tried doing the telnet, and it says:
    Connecting To database...Could not open a connection to host on port
    1433 :
    Connect failed


    Really do appreciate your help!

    "Wessel Troost" wrote:

    > - Post the connection string, we might be able to help.
    > - "telnet sqlserver 1433" to see if you can reach the SQL server. 1433
    > is the default SQL server port.
    > - Check the firewall settings on the SQL Server.
    > - Check if the SQL Server user has a default database, and if the user
    > is valid in that database.
    >
    > Greetings,
    > Wessel
    >
    > -----Original Message-----
    > From: Ann Marinas [mailto:]
    > Posted At: Sunday, April 10, 2005 12:55 PM
    > Posted To: microsoft.public.dotnet.framework.aspnet
    > Conversation: Separate Webserver and SQL Server -- error when

    connecting
    > asp.net app to a database
    > Subject: Re: Separate Webserver and SQL Server -- error when

    connecting
    > asp.net app to a database
    >
    > Hi, Wessel!
    >
    > Thank you for your reply.
    >
    > I've changed my connectionstring property after the database was
    > transfered to another server and it has got all the correct values,

    but
    > still no avail.
    >
    > Thanks again for helping me out! Really do appreciate it!
    >
    > Cheers,
    > Ann
    >
    > Wessel Troost wrote:
    > > An ASP.NET application typically connects to the database through a
    > > System.Data.SqlClient.SqlConnection object.
    > > To change the SQL server, you need to find all SqlConnection objects

    > and
    > > update their ConnectionString property to point to the new database
    > > server.
    > >
    > > Greetings,
    > > Wessel
    > >
    > > -----Original Message-----
    > > From: Ann Marinas [mailto:]
    > > Posted At: Sunday, April 10, 2005 12:11 PM
    > > Posted To: microsoft.public.dotnet.framework.aspnet
    > > Conversation: Separate Webserver and SQL Server -- error when

    > connecting
    > > asp.net app to a database
    > > Subject: Separate Webserver and SQL Server -- error when connecting
    > > asp.net app to a database
    > >
    > > Hi all,
    > >
    > > I would like to ask for some help regarding separating the asp.net
    > > webserver and the sql server.
    > >
    > > I have created an asp.net application for a certain company.

    > Initially,
    > > we installed both the iis and sql server in a single machine. Not

    too
    > > long ago, the machine had some hardware problems, and management has


    > > decided to purchase new servers, for both asp.net and sql server.
    > >
    > > Once we installed my webapp on the first server and the sql server

    on
    > > another, we have encountered some errors with it. Basically, the
    > > exception that keeps on saying was:
    > >
    > > "SQL Server database does not exist or access denied."
    > >
    > > Tried creating a windows account for the webapp to use to connect

    and
    > > configure it to the sql server, but it does not work.
    > >
    > > Tried also connecting with the database using a SQL Server account,

    > but
    > > to no avail.
    > >
    > > Please help! I would really appreciate it!!
    > >
    > >
    > > Regards,
    > > Ann Marinas
    > >

    >
    >
     
    Wessel Troost, Apr 11, 2005
    #11
  12. Ann Marinas

    WJ Guest

    WJ, Apr 12, 2005
    #12
  13. Ann Marinas

    Guest Guest

    Re: Separate Webserver and SQL Server -- error when connecting asp.net app to a database

    One of my developers had the same problem and I fixed it by changing the
    identity with which ASP.NET
    process was running that web-application. Add the following section to your
    application's web.config file:
    <system.web>
    <identity impersonate="true" userName="someaccount" password="something"
    />
    </system.web>

    Note that provided windows user account must have granted required
    permissions to access the remote database.

    I also tried something else which worked but this one was more preferred. I
    will be pleased if you let me know other solutions you may find.

    Jamal

    ----- Original Message -----
    From: "Ann Marinas" <>
    Newsgroups: microsoft.public.dotnet.framework.aspnet
    Sent: Sunday, April 10, 2005 2:41 PM
    Subject: Separate Webserver and SQL Server -- error when connecting asp.net
    app to a database


    > Hi all,
    >
    > I would like to ask for some help regarding separating the asp.net
    > webserver and the sql server.
    >
    > I have created an asp.net application for a certain company. Initially, we
    > installed both the iis and sql server in a single machine. Not too long
    > ago, the machine had some hardware problems, and management has decided to
    > purchase new servers, for both asp.net and sql server.
    >
    > Once we installed my webapp on the first server and the sql server on
    > another, we have encountered some errors with it. Basically, the exception
    > that keeps on saying was:
    >
    > "SQL Server database does not exist or access denied."
    >
    > Tried creating a windows account for the webapp to use to connect and
    > configure it to the sql server, but it does not work.
    >
    > Tried also connecting with the database using a SQL Server account, but to
    > no avail.
    >
    > Please help! I would really appreciate it!!
    >
    >
    > Regards,
    > Ann Marinas
     
    Guest, May 5, 2005
    #13
    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. EvgueniB
    Replies:
    1
    Views:
    664
    Anthony Borla
    Dec 15, 2003
  2. =?Utf-8?B?TmVpbCBQYWRkb2Nr?=

    Connecting to SQL 2000 database with SQL 2005 tools installed

    =?Utf-8?B?TmVpbCBQYWRkb2Nr?=, May 2, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    415
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    May 2, 2007
  3. David Thielen
    Replies:
    3
    Views:
    1,632
    Steven Cheng [MSFT]
    Sep 1, 2008
  4. Ravi
    Replies:
    0
    Views:
    496
  5. Arthur Zubarev
    Replies:
    0
    Views:
    90
    Arthur Zubarev
    Feb 3, 2014
Loading...

Share This Page