ASP.net SQLconnection string question

My Application has this string

<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/> -->

I moved the app from SBS 2003/SQL 2005 Workgroup to W2k8 R2 with SQL 2008 R2 Express server and getting ASP error that it can't connect to the SQL server

What do I need to do get it connected?
LVL 1
piotrmikula108Asked:
Who is Participating?
 
ee_reachConnect With a Mentor Commented:
connectionstrings.com is your friend.  They have everything you ever wanted to know about connection strings.
0
 
ee_reachCommented:
Also make sure you need to bind to the same port. Since 42424 is not a "well known port number" it may not be configured that way on the new server.
0
 
piotrmikula108Author Commented:
thx great resource

how do I make my new serve to accept Trusted Connection that is specified in the string?

also do I add the 42424 port under SQL Server Configuration Mnager > Protocols > MSSQLSERVR > TCPIP > IP Adresses? do i replace all the 1433 entries with 42424?

Also I could change the string to this one

Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;

and then use default port???
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
ee_reachCommented:
My experience is more with 2005 than 2008.  (I mostly work with MySQL.)  However, I think the instructions in this page are pretty compatible and you can probably use them as a guide to get you rolling.  (Even some of the historical comments are useful.)

http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx

IIRC, 1433 is the default port.  so you would either need to replace all entries with 42424 or you would modify your connection string to change it to 1433.  Probably you can leave it off the connection string as long as you open the port on the firewall or server or whatever.

Re trusted connection, see example #2 in the following link:
http://www.sql-server-helper.com/sql-server-2008/sqlconnection-connection-string.aspx

0
 
ee_reachCommented:
To be clear, when I said:
"IIRC, 1433 is the default port.  so you would either need to replace all entries with 42424 or you would modify your connection string to change it to 1433.  Probably you can leave it off the connection string as long as you open the port on the firewall or server or whatever."

What I meant was that if you are using the default port of 1433, then you may be able to leave it off the connection string.  Not sure about that, and it certainly is safer to include it than to leave it off until you get everything else working.

Another thing to check is that you have the right ODBC driver for SQL Server 2008.  If you haven't updated it from the ODBC driver that you used with SQL Server 2005, it probably is out of date.
Have a look at this article:
http://social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/a6535e6e-19ef-47b5-bee1-849446fa8cf4


Probably the one for 2005 will not be sufficient.
0
 
TempDBACommented:
No need to change the port number.
Just make sure that your sql server is on mixed authentication mode and the domain to which your windows authentication works has been created as a login to the server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.