Trouble connecting asp.net app to remote sql server

I have an asp.net app written in vs2008 using vb.net. I'm attempting to connect to a sql server 2005 DB that's on another machine. All's well when I connect to the server on the development machine.

In the tcp/ip property pages, there are ip addresses given for IP1 and IP2, but they are different from the machine IP address.  which one should be in the connection string,  

and does someone have an example of a connection to connect to a remote sql server, so far, among the many I've tried are:

' Dim builder As New SqlConnectionStringBuilder
' With builder
'.DataSource = "123.123.123.123\Server\Name"                                                     'Error 26

'.DataSource = "123.123.123.123\Server"                                                        'Error 26

' .DataSource = "tcp:\\123.123.123.123" ' TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

'.DataSource = "tcp:\\123.123.123.123\Server\Name"                                                  ' TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)"

'.DataSource = "np:123.123.123.123" ' provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

'.DataSource = "np:123.123.123.123\\.\pipe\MSSQL$HCSERVER\Sql\query" ' error: 26 - Error Locating Server/Instance Specified)"

'.DataSource = "lpc:123.123.123.123" 'error: 41 - Cannot open a Shared Memory connection to a remote SQL server)"

'.DataSource = "lpc:123.123.123.123\SAMSSQL\HCSERVER" error: 41 - Cannot open a Shared Memory connection to a remote SQL server)"

'.DataSource = "lpc:123.123.123.123\SAMSSQL" error: 41 - Cannot open a Shared Memory connection to a remote SQL server)"

'.DataSource = "np:\\123.123.123.123\\.\pipe\MSSQL$SAMSSQL\HCSERVER\Sql\query" ' Named Pipes Provider, error: 5 - Invalid parameter(s) found)"

'.DataSource = "np:\\123.123.123.123" ' error: 25 - Connection string is not valid)"

'.DataSource = "tcp:\\123.123.123.123" ' error: 25 - Connection string is not valid)"

'.DataSource = "tcp:\\123.123.123.123\SAMSSQL\HCSERVER" 'error: 25 - Connection string is not valid)"

also I set
IntegratedSecurity = True
InitialCatalog = "Name"
UserID = "UID"
Password = "Password"'

and at times have used AttachDBFileName = "path of the file"

Any thought on why I'm having so much problems connecting?

Thanks in advance.

JB
jbh_blueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TechTiger007Commented:
You can get the connection string here
http://www.connectionstrings.com/

You can also use SQLConnectionStringBuilder class to create the connection string
0
CodeCruiserCommented:
1) You are setting the integrated security to true as well as supplying user name and password.
2) Why do you need to supply the protocols and ip address? "Data Source=TheDeveloper" should suffice for default instance and "Data Source=TheDeveloper\SQLEXPRESS" should be used for a named instance with name being SQLEXPRESS.
3) Do you have the client protocols enabled in the SQL Server network configuration wizard?
4) Do you have remote connections enabled in the SQL Server Surface Area Configuration?
5) Do you have the SQLBrowser service enabled and running on the SQL Server?
0
jbh_blueAuthor Commented:
1) I've removed  the integrated security setting.

2) I got the advice about using the ip address from another poster, but it doesn't seem to make any difference.

3) I'm not sure what this is but am looking for it. It's not on my menu options.

4) Yes, I have Shared Memory, Named Pipes, and TCP/IP enabled.

5) Yes

I removed the integrated security property, and added the server name and instance as DataSource and was able to connect successfully, (or at least it seems)
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

CodeCruiserCommented:
My suggestion helped you and you still are closing the question without giving any points?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jbh_blueAuthor Commented:
TechTiger007 and CodeCruiser, thank you both very much.

0
jbh_blueAuthor Commented:
Code Cruiser, I gave you points.
0
jbh_blueAuthor Commented:

Dude, I gave you points (350) and (150) to Tech Tiger, for him helping me with www.connectionstrings.com and the stringbuilder.

I'm new to this site and if somehow I screwed up and you didn't get your points, let me know and tell me who to contact and I'll do my best to make sure you get your credit. But I specifically was given a screen on how to split the points between you two.

Again,  Many thanks,

JB
0
CodeCruiserCommented:
Its alright now. I just received the points now.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

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.