Results 1 to 5 of 5

Thread: Connecting Successfully to SQL Server 2008

  1. #1

    Thread Starter
    Hyperactive Member GamerMax5's Avatar
    Join Date
    Nov 2004
    Location
    United States
    Posts
    388

    Connecting Successfully to SQL Server 2008

    Hi everyone. I'm going to tryto be as descriptive as possible becase I'm sure that this is a deep problem.

    I'm basically trying to learn how to use ASP.NET, SQL Server 2008, and Visual Web Developer 2008, and the C# language (for ASP.NET). I'm familiar with Apache Tomcat and JSP so I figured I might as well try the Microsoft end of the server scripting world.

    The website I created with VWD contains just one simple page with six ASP tagged controls on it. There are four textboxes and two buttons: one to submit the information to the server and the other to clear out the fields. Obviously, the behavior for the clear button is straightforward enough to where it doesn't need any serious conversation. What I am having problems with, if you haven't guessed it by now, is the submit button.

    In the method call for the submit button I attempt to open a connection to an active instance of SQL Server and access the database that I'm looking for within it. This is where I get my error. Calling the Open method from an instance of SqlConnection returns an infamous error 40 message saying that, basically, the code can't find an instance of SQL Server. Now here are the things that I've tried but haven't worked:

    1. Double checked to make sure that an instance of SQL Server was running while the website was running, which it was. I've checked this numerous times.
    2. Made sure the port being used by both the website and SQL Server was not being blocked by my firewall. I even went as far as adding the ports to my exceptions list.
    3. Enabled TCP/IP in SQL Server. I don't really know why it was disabled by default but I'm not Microsoft.
    4. I'm not sure if this makes any difference at all but I even synchronized the ports that the website and SQL Server uses. When I found out this didn't work I reset the ports back to what they were in the first place.


    Short of doing all this I'm not sure what else I can do to get this to work. I don't remember Tomcat giving me this much trouble before but I'm really trying hard not to give up on this. Any help would be greatly appreciated. Thanks in advance.
    Last edited by GamerMax5; Apr 17th, 2009 at 04:51 AM.
    Only those who try will become.

    Find me on identi.ca

    Twitter @gfmartin05

    Linux Wrap

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Connecting Successfully to SQL Server 2008

    Sorry to disappoint you after you typed all that but I don't think this is the right forum for C#/ASP/SQL Server issues - its a VB.Net forum!

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Connecting Successfully to SQL Server 2008

    Hey,

    Paul is correct, you have posted in the VB.Net forum, but your question really belongs in the ASP.Net Forum, I will ask a Mod to move it.

    Getting back to your question though, is it possible that you can show us the code that you are currently trying to use? That is probably the best way of getting an answer to your question.

    Gary

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Connecting Successfully to SQL Server 2008

    Moved To ASP.NET

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Connecting Successfully to SQL Server 2008

    Welcome to ASP.NET. Don't summarize the error message, give us the exact error message.

    Go to Sql Surface Area Configuration and allow remote access to the instance if it's one of those 'remote connections not allowed' errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width