Server Error

Discussion in 'ASP.NET 2.0' started by dagreenstar, Dec 4, 2006.

  1. Hello all...this is my first post as I'm getting to know the.net technology. I finished a project which islike the quiz engine on thetut page, but when I uploaded all files and databases to the server, this is what I got:

    "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"


    Can anyone explain to me what's going on, your feedback is very appreciated!




    Post Edited By Moderator (mjp) : 12/5/2006 1:55:08 AM GMT
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    this error is usually a result of your application trying to connect to a SQL Express database. Check your connection string and make sure your app is trying to connect to MSSQL rather than Express.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I just bought a web hosting account from discount ASP.net, and I used Visual Web Developer 2005 Express Edition for my application that has three databases, but now I realize when I go to the control panel of my web server, thatmy account doesn't havean activated MSSQL. I'm wondering, is buying a MS SQL the answer to my issue previousely described or there's a way to make my small roject work, I'm a student...and before buying this sever, I was under the impression that at least it will come with one db. any insight?
     
  4. Yes,if you have not yet purchased an DB addon ,you will have to do that to have a db associated with your account.This can be done using the 'Addons Manager' in your Control Panel.
    MySQL is provided at a very low cost ,but I would suggest you to gowith a MS SQL 2005 due to its advanced features and has a far greater integration with MS .NET framework.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanx for the reply...now I'm looking to buy an MS SQL 2005 db. in the control panel, it says that I can buy one with 300M space for $10 a month, also, it is asking me to provide a name for the db. In my project I have 2 dbs, they are: ASPNETDB.MDF, and test.mdf. I'm confused as to which one to mention while buying thedb. I tried one, but it said "Database Name can only contain alpha-numeric characters and must be between 1-12 characters in length." I'm just confused and really have no idea on how to deal with this.do I need to buy 2 dbs if I have 2 in my project? and what the name should look like? thank you so very much for your help.
     
  6. The DB naming is for your DB account.
    Your SQL DB will be in a tree among other accounts.
    Your individual tables can all be imported into that account so the naming you chose isn't critical to any point.
     
  7. The DB name you specify is one you will be alloted on DASP sql servers.So you could choose any alpha-numeric character name for it,irrespective of any of the database's you have.Once you are done with that,you could attach the test.mdf using the 'Sql Tool Suite' (Control Panel>MS SQL 2005>Sql Tool Suite) and then create the ASPNETDB schema (see:http://kb.discountasp.net/article.aspx?id=10413 for the later) .

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. I did attach the test.db, but the last step which is<!--StartFragment -->configuring the ASP.NET 2.0 Membership, is really driving me crazy...I have the info of MS SQL 2005, and this is what Im using in the web.config document:



    <connectionStrings>


    <remove name="LocalSqlServer" />


    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k505.discountasp.net;Initial Catalog=SQL2005_310477_db01omar;User ID=SQL2005_310477_db01omar_user;Password=******;" providerName="System.Data.SqlClient"/>


    </connectionStrings>


    when I request the url, I have an error message:


    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Required attribute 'connectionString' not found.

    Source Error:





    Code:
    Line 5:    <connectionStrings>
    Line 6:      <remove name="LocalSqlServer" />
    Line 7:      <add name="Data Source=tcp:sql2k505.discountasp.net;Initial Catalog=SQL2005_310477_db01omar;User ID=SQL2005_310477_db01omar_user;Password=******;" providerName="System.Data.SqlClient" />
    Line 8:    </connectionStrings>
    
    What am I doing wrong, thank you so much for ur help guys..
     
  9. From the error message it is clear that the connection string you provided in the web.config has a syntactical mistake.

    The ConnectionString you provided has
    <add name='LocalSqlServer' connectionString='Data Source=tcp:sql2k505.discountasp.net;Initial Catalog=SQL2005_310477_db01omar;User ID=SQL2005_310477_db01omar_user;Password=******;' providerName='System.Data.SqlClient'/>

    and your error states

    <add name='Data Source=tcp:sql2k505.discountasp.net;Initial Catalog=SQL2005_310477_db01omar;User ID=SQL2005_310477_db01omar_user;Password=******;' providerName='System.Data.SqlClient' />

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  10. thank you Vikram...I tried that piece of code...it just dosent work..man, I spent the whole day trying to get this working...I'm really discouraged!!
    sobelow is my sql information, how can I possibly configure my application in the web.config, what would the code look like...thanx a lot guys, I understand if no one wants to reply...it is frustrating...but thank you antway!





    SQL Server Name
    sql2k505.discountasp.net

    Database Name
    [​IMG]SQL2005_310477_db01omar

    Database Space

    300 MB (Add SQL Disk Space)

    Database Login
    [​IMG]SQL2005_310477_db01omar_user
     
  11. You site seems to work fine.I was able to get to the default page of your application.
    While registering I get a 'Login Failed..' exception.


    Make sure your Connection string looks like this:

    <connectionStrings>
    <remove name='LocalSqlServer' />
    <add name='LocalSqlServer' connectionString='Data Source=tcp:sql2k505.discountasp.net;Initial Catalog=SQL2005_310477_db01omar;User ID=SQL2005_310477_db01omar_user;Password=<YOUR HOSTING ACCOUNT PASSWORD>;' providerName='System.Data.SqlClient'/>
    </connectionStrings>

    By default,your DB password is the same as that of your hosting account.

    Make sure that if you using any other connection string with your application other than 'LocalSqlServer' ,an entry for it should also exist above and will look similar to that of 'LocalSqlServer'.

    Hope this helps!

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 12/5/2006 8:56:26 AM GMT
     

Share This Page