Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Connecting to a SQL Server in Different Domain

Author  Topic 

aamird
Starting Member

1 Post

Posted - 2008-09-07 : 04:50:29
Hi,
I am using SQL 2005.
I need to connect to my company's Application to our Sister concern SQL Server. The Domains are different.
How do i connect using VB.NET?

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-07 : 05:29:06
see www.connectionstrings.com

are you using a desktop app or web app ?

If you are using a web application, put your connection string in your web.config file and reference it with the variable name. In your code behind or preferably in a class with


SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Your_ConnectionString"].ConnectionString.ToString());


using the namespace

using System.Data.SqlClient;

read up on ado.net's sqlclient
Go to Top of Page
   

- Advertisement -