Showing posts with label dsn. Show all posts
Showing posts with label dsn. Show all posts

Monday, March 12, 2012

how to add ODBC DSN to multiple computers

Hello. I need to set add an SQL ODBC System DSN to each computer on
our domain.
The suggestions I've seen so far involve setting up a GPO startup
script using VBScript to call an API, or a batch file using odbcconf.
I don't know VB, and I could find very little information about how to
use odbcconf.
I would appreciate it if someone could give me a standard solution, if
there is one. I'm a little new to this, so I wouldn't be surprised if
I were completely off the mark.
thanks,
joseph
If the use of a DSN is not really mandatory for your application, then using
a DSN-Less ODBC connection might be an easier solution.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Joseph O'Brien" <obrien1984@.hotmail.com> wrote in message
news:1139438690.109709.324280@.g47g2000cwa.googlegr oups.com...
> Hello. I need to set add an SQL ODBC System DSN to each computer on
> our domain.
> The suggestions I've seen so far involve setting up a GPO startup
> script using VBScript to call an API, or a batch file using odbcconf.
> I don't know VB, and I could find very little information about how to
> use odbcconf.
> I would appreciate it if someone could give me a standard solution, if
> there is one. I'm a little new to this, so I wouldn't be surprised if
> I were completely off the mark.
> thanks,
> joseph
>

how to add ODBC DSN to multiple computers

Hello. I need to set add an SQL ODBC System DSN to each computer on
our domain.
The suggestions I've seen so far involve setting up a GPO startup
script using VBScript to call an API, or a batch file using odbcconf.
I don't know VB, and I could find very little information about how to
use odbcconf.
I would appreciate it if someone could give me a standard solution, if
there is one. I'm a little new to this, so I wouldn't be surprised if
I were completely off the mark.
thanks,
josephIf the use of a DSN is not really mandatory for your application, then using
a DSN-Less ODBC connection might be an easier solution.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Joseph O'Brien" <obrien1984@.hotmail.com> wrote in message
news:1139438690.109709.324280@.g47g2000cwa.googlegroups.com...
> Hello. I need to set add an SQL ODBC System DSN to each computer on
> our domain.
> The suggestions I've seen so far involve setting up a GPO startup
> script using VBScript to call an API, or a batch file using odbcconf.
> I don't know VB, and I could find very little information about how to
> use odbcconf.
> I would appreciate it if someone could give me a standard solution, if
> there is one. I'm a little new to this, so I wouldn't be surprised if
> I were completely off the mark.
> thanks,
> joseph
>

Sunday, February 19, 2012

How to access to database with c# using DSN

Hello, im new in c# language.

Can someone show me, step by step(with simples code) how can i connect to a DSN connection that aconfigure in my odbc connection in my machine, to connect to mydatabase ?

I need only a simple class that use a DSN connection to retreive information from the database.

Best regards

You don't want to use a System DSN. A System DSN uses ODBC which is a wrapper for OLE DB, meaning that you're talking about a lot of unnecessary overhead. The .Net System.Data.SqlClient classes talk directly to the SQL Server, without having to use OLE DB OR ODBC. Instead, you need to figure out how to build your Connection correctly.

TryConnectionStrings.com.

|||

Im not use SQL server, my database is db2 in AS/400.

Do u know how to connect directly to an as/400 database ?

|||

Hi,

From you description, it seems that you want to connect to your DB2 database by using DSN, right?

I suggest that you can try DB2OdbcFileConnectionString class which describes a DB2 ODBC file connection string.

To create a DSN file and associated connection string

Call the constructor for DB2OdbcFileConnectionString, DB2OdbcSysConnectionString, or DB2OdbcUserConnectionString.
Calling the constructor creates a connection string with default settings. These default settings can be set only through the Data Access Tool user interface.

If you use a file path for a file that currently exists, the system loads the connection string information in that file instead.

Fill in the relevant connection string properties with a call to the properties of the object created.
You can also fill in the connection string with GetString, which returns the connection string as a text string. Once you finish modifying the relevant values, you can return the connection string to the object with a call to SetString.

Save the connection string information back into storage with a call to Save.

For more information, see:
http://msdn2.microsoft.com/en-us/library/ms945575.aspx

Thanks.