sql server 2008 problem

Discussion in 'Getting started' started by turkmessage, May 24, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Firstly Hi,

    I have a problem on connection of sql server 2008.
    I have uploaded a mvc web site based sql database.
    But unfortunately i have a warning following.

    "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

    I tried to change my connection string of web.config by using the connection string on discountasp

    how can i solve this problem to be able my web site to run?

    kind regards

    Mustafa
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Can you post the connection string section in the web.config? Make sure you remove the username / password before posting.
     
  3. detailed

    Here the connection string shown on discountasp sql 2008 database server is.

    "Data Source=tcp:esql2k802.discountasp.net;Initial Catalog=SQL2008_733798_kardelen;User ID=SQL2008_733798_kardelen_user;Password=******;"


    i added it to my web.debug.config in the web.config
    but there are still code sentences including connection string like following.

    "SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|Dat"

    The main question in my mind is that when i use visual studio 2010 .it uses sql express 2008 database? and Is it need to use sql 2008 server to make it run on the web?

    and what do i need to do to make MVC2 web site using sql database run?
     
  4. Hi,
    I definitely need to create a webcast with some tips for this sort of thing.
    VS2010 will indeed default to your local SQL Express.

    What I recommend is adding your remote DASP SQL Server to the Server Explorer.
    Then you will see it in VS and you can expand and use what you need.
    This also makes it easy to confirm your page is not using SQL Express for the connection.

    As for the Express connections in the web.config I'd recommend backups.
    Have one you use for local tests, one you use for local to remote, live, etc.
    It's a good habit because having a web.config work one day but not the next will give you options. ;-)
    All the best,
    Mark
     
  5. I like the web config xslt transformation stuff that can get done at publish/deployment time in VS2010. It makes local testing with a local db and later deployment to the DASP servers 'click and forget'.
     
  6. ..It is cool but only works with Web Apps, will not show/function for Web Sites in VS2010.
    Salute,
    Mark
     
  7. Hi again.as you know time is precious and i don't have enough time to solve this kind of problem .please help me:)))
    i don't know how to do "What I recommend is adding your remote DASP SQL Server to the Server Explorer".i have to make all things tomorrow.(wed.)

    actually the only thing i need is to make my database run.actually now i added a sample project.etc.

    your help will leave me a great impression on discountasp.net
     
  8. ...I'll keep checking this thread tonight;
    Are you saying you can't run a local instance of SQL Server? Like maybe blocked by a firewall?
    All the best,
    Mark
     
  9. Hi again,
    Actually i use visual studio 2010 and it uses sql express 2008 (i guess)

    i bought sql server 2008 support from discountasp to work.

    how can i make the web site (mvc2) run.it has a database connection problem.

    this is my username of discountasp.net~ igummcom000

    if you have a permission to check for my acoount .i m sure that u can easily solve this problem.this s crucial for me bcoz i have to make everything run on thursday.


    thanks for help ..

    i m going to check for new thread
     
  10. ...OK, I do connect to the DASP remote SQL 2008 DB Servers from VS2010 so I can assure you it does work. ;-)

    1) With your solution/site open in VS2010 click on the Server Explorer tab on the right.
    Alternatively you can press Ctrl+Alt+S
    2) Now that it is showing click on the upper icon "Connect to Database"
    (I'm guessing at this point you were trying to "Connect to Server")
    3) When the dialog opens it should be large, not small.
    Large will be what we need here, Connect to DB, small would be for Connect to Server.
    Enter the Server name, the IP address of your DASP SQL Server.
    i.e. tcp:sql2k512.discountasp.net
    In the "Log on to Server" section put a tick in "Use SQL Server Authentication".
    Now enter your DASP SQL Server username and password.
    Put a checkmark in "Save my Password"
    You can enter the database name in the section below or leave that blank.
    Click the Test Connection button. It that checks out go ahead and click OK.

    Once it shows in the "tree" you can expand the nodes right there in the Server Explorer.

    If this doesn't work let me know. ;-)
    All the best,
    Mark
     
  11. Hi again

    Actually i could not understand what exactly this is used.I got new dataconnection(this is online) and when i attachted my mdf file on it via the internet.on visual studio this new data connection had the mdf file i attached.everything seemed ok but neither my mvc project worked nor the project on windows did.this is so bad bcoz time is melting for me.
    i have a new question when i create a new entity can everything be ok for web?igumm.com still makes a warning about sql server connection error.

    i'm confused and sad.i want to learn how i can make these things work.i want to use visual studio on line instead of local.thus this problem can be solved if i create so .

    thanks for helpp again
     
  12. Hi,
    Once you attach the MDF you can remove it from your site.
    You can't connect to the MDF on-line for DASP sites.
    After it is attached it will populate your DASP SQL Server DB.
    Make sense?

    I can create a Webcast showing how to do this entire thing for VS2010 if needed.

    Keep in mind this will also require a valid modification to your web.config
    That part is what throws a lot of developers off, I've personally helped a bunch of them get past that part.
    All the best,
    Mark
     
  13. Actually i don't have enough knowlegde to understand what you said exactly.
    the only thing i want to solve is that to make a mvc project run on discountasp.net

    Webcast will be good for me.now i feel so bad time is melting here in istanbul.

    To sum up. i uploaded my project files to discountasp.net via cuteftp.

    i have 2 mdf file in app.data cluster.

    what am i supposed to do to make eveything run.

    this is The question i could not solve yet.

    i have a project running on windows but it fails on discountasp.net .

    anyway my msn is [email protected]
     
  14. Hi,
    I'm working on another webcast right now but still willing to try and help you with this.
    What are the two MDF files you have?
    Only one can be attached but we can work something out for you.
    If one of them is Membership you are going to have a bit more trouble but I can still help with that.

    As you see I do need a few more details to be able to offer help.
    All the best,
    Mark
     
  15. For example this is a part of web.config.

    <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="MusicStoreEntities" connectionString="metadata=res://*/Models.StoreDB.csdl|res://*/Models.StoreDB.ssdl|res://*/Models.StoreDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MvcMusicStore.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>

    as u see one of them is membership the other is a normal one having the data
    what do i need to do? i have a few hours to solve this problem?

    urgent
     
  16. Hi,
    The connection strings you posted are using SLQ Express which is not allowed.
    You must Attach the MDF file before you can use it.
    To do that you must have a SQL Serve addon.
    The webcast I'm finishing right now shows how to do that.

    You can only attach one MDF at a time, any additional MDF attach will wipeout the previous one.

    Your choices are:
    1) Merge the two MDF files into one, then attach that one.
    You can do this with SQL Express using SQL.

    2) You can purchase an additional Database for your account and use two databases.
    That is going to cost more and is actually overkill, best method will be to merge your data.

    ...How did you end up with two MDF files in this project?
    It may actually be easier for you to recreate the data in a single MDF file.
    All the best,
    Mark
     
  17. hi again, i have a sql server add on.
    and when merging two database everything can be bad bcoz membership one can make trouble but i guess i can work on it ill try.

    i'm looking forward to your web cast.actually if you have an e-mail i can send my discount info to check for the situation and maybe you can make things work.i need that bcoz i don't have time

    thanks for your help
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page