Trouble connecting app to remote sql server

I have an app written in vs2008 using 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 = "\Server\Name"                                                     'Error 26

'.DataSource = "\Server"                                                        'Error 26

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

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

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

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

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

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

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

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

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

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

'.DataSource = "tcp:\\\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.

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.

Toms EdisonTechnical ManagerCommented:
You can get the connection string here

You can also use SQLConnectionStringBuilder class to create the connection string
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?
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)
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

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

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.

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

Dude, I gave you points (350) and (150) to Tech Tiger, for him helping me with 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,

Its alright now. I just received the points now.
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.