Sql server CONNECTION STRING...

Hi all,
I am trying to make a connection string for the SQL SERVER..in all the sites i m getting
To connect to SQL Server running on a remote computer (via an IP address)

oConn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"

but i cant understand where should i write this in the QUERY WINDOW(it doesnt work)...where exactly should i write this connection string....
unlike in oracle there is NET MANAGER where i can just create a new SERVICE NAME....but here can someone PLEASEEEEE tell me
any help will be greatly APPRECIATED
Regards.


Answer this question

Sql server CONNECTION STRING...

  • dcumg

    How can I use a connection string from the data flow in a script component

    Can you show me an example

    Thank you.


  • DaveMartinNassco

    thnks a lot....:)
  • Justin C

    Hi,

    Yes. You can use the same connection string in your Script Task also.

    Thanks & Regards,

    Prakash Srinivasan.


  • Ty Y

    Hi,

    You basically need to copy the Connection string in any of your SQL Connections (which will be in the Connection Manager). Right Click your Script Task and Edit, and then in Edit Window, click Design Script to write your vb.net code.

    In your Script Task, import the following namespaces

    Imports Microsoft.SqlServer.Dts.Runtime

    Imports System.Data.SqlClient

    and then create objects for SQL Connection and write your Connection String like below

    Dim strConnSQL As String

    strConnSQL = "Data Source=<Server Name>;User ID=<User ID>;Pwd=<Password>; Initial Catalog=<Database Name>;Persist Security Info=True;"

    Dim Conn As SqlConnection = New SqlConnection(strConnSQL)

    and then you can write your VB.Net code as you want.

    Hope this helps you out.

    Thanks & Regards,

    Prakash Srinivasan.


  • Volksie

    You ARE using SQL Server Integration Services aren't you If you are not then this is completely the wrong forum for you.

    If you are then you are you should be in the Business Intelligence Development Studio. Open up a package. When it opens up there is a space at the bottom called "Connection Managers". you create them in there.

    -Jamie



  • B_Li

    In SSIS all connection managers to external data sources are done using Connection Managers. Create yourself a new OLE DB connection manager and copy your connection string into the Connection manager's ConnectionStrig property.

    -Jamie


  • Hasie

    Hi,

    Can I use a connection string to sql server in a script component

    Thanks in advance,

    Reut.


  • jcrawfo2

    but where is this CONNECTION MANAGER and how can i create a new OLE DB connection manager i m new to sql server...can you please tell me in a little more DETAIL pleaseeeee
    thnks a lot for your reply...

  • Sql server CONNECTION STRING...