|
-
Apr 17th, 2009, 04:47 AM
#1
Thread Starter
Hyperactive Member
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:
- 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.
- 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.
- Enabled TCP/IP in SQL Server. I don't really know why it was disabled by default but I'm not Microsoft.
- 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.
-
Apr 17th, 2009, 04:56 AM
#2
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!
-
Apr 17th, 2009, 06:33 AM
#3
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
-
Apr 17th, 2009, 06:51 AM
#4
Re: Connecting Successfully to SQL Server 2008
-
Apr 17th, 2009, 01:52 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|