473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to create an ODBC Datasource programatically in C#

Hello All,

Does anyone know how to programatically create an ODBC datasource in C#?

I want to access some comma separated files using ODBC, and I don't want to
go into the configuration utility for ODBC and create them manually.

Thanks in advance.

Mike
mg********@cp.org
Nov 16 '05 #1
1 3183
Just think about what an "ODBC datasource" is under the hood...
A "User" ODBC data source is just a text file, with the extension .dsn. Have
a look at an existing one to determine what to write and where...
A system data source is slightly more complex, but not much. It's just a
registry setting.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: panda | last post by:
Dear ALL, I was trying to connect to a remote AIX DB2 database from a Windows 2000 machine in two ways: 1) Use DB2 client in Windows to connect to the cataloged DB I typed "db2 connect to...
1
by: MLH | last post by:
I'm running XP. Is it required that a given ODBC driver be selected or set somehow as a default driver? Look at this... Here's the error: Error: ODBC call failed... Datasource not found and no...
8
by: DerekS | last post by:
Hi, I've been pulling my hair out trying to write a simple method to programatically create a system DSN with all parameters on a remote machine. I have ensured I have the correct permissions on...
2
by: 1qa2ws | last post by:
Hi, I really don't know how to use DataGridView with ODBC connection. I have an DSN ODBC connection and I know how to connect to it. I can query the database. I'd like to get the query result...
2
by: Robert Brown | last post by:
Hi All.. This is a strange one that I hope someone has come across. I have an asp.net application that needs to access a flat file databse via ODBC. I have setup the OBDC DSN and tested it...
1
by: MethMath | last post by:
I have problems with a webservice receiving data in turn updating an Odbc-linked Access database on the same computer. The Odbc engine gives me an OdbcExceptionError: Message: Operation must...
2
by: bcbrock | last post by:
I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server. Both servers are Windows Server 2003 SP2. My...
6
myusernotyours
by: myusernotyours | last post by:
Hi! I want to access a database (ms access) without having to create a datasource from the control panel. Can i create a datasource dynamically so that my users only need to specify the path? help...
5
by: cj2 | last post by:
This code works: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Linq; using System.Web; using System.Web.Services; using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.