Home All Groups Group Topic Archive Search About

ConnectionString for comma-delimited file

Author
16 Nov 2005 7:28 PM
FireStarter
Is there a way to connect through an OleDBConnection to a
comma-delimited file? Then I could read records through a DataReader.
I was thinking it could be done through the ExtendedProperties, but I
cannot find the right value for it (I would probably need to specify
field and row delimiters).


Thanks.

Author
16 Nov 2005 8:01 PM
Jerry H.
You could try this:

http://www.developerfusion.co.uk/show/961/

It uses the MS Jet
Author
16 Nov 2005 8:23 PM
FireStarter
Thank you, after a couple of changes to bring it to C# syntax, this
worked perfectly.


Jerry H. wrote:
Show quote
> You could try this:
>
> http://www.developerfusion.co.uk/show/961/
>
> It uses the MS Jet
>
Author
16 Nov 2005 8:07 PM
samnissim
Unless you have a special reason for using OleDbConnection, create a
data source in ODBC using the Microsoft Text Driver.  Then use
OdbcConnection instead of OleDbConnection.

FireStarter wrote:
Show quote
> Is there a way to connect through an OleDBConnection to a
> comma-delimited file? Then I could read records through a DataReader.
> I was thinking it could be done through the ExtendedProperties, but I
> cannot find the right value for it (I would probably need to specify
> field and row delimiters).
>
>
> Thanks.
Author
16 Nov 2005 8:25 PM
FireStarter
Thank you for the idea. I went with OleDB because I wanted the solution
to be portable on other comps w/o having to add ODBC sources. It would
have worked, though.


samnis***@gmail.com wrote:
Show quote
> Unless you have a special reason for using OleDbConnection, create a
> data source in ODBC using the Microsoft Text Driver.  Then use
> OdbcConnection instead of OleDbConnection.
>
> FireStarter wrote:
>
>>Is there a way to connect through an OleDBConnection to a
>>comma-delimited file? Then I could read records through a DataReader.
>>I was thinking it could be done through the ExtendedProperties, but I
>>cannot find the right value for it (I would probably need to specify
>>field and row delimiters).
>>
>>
>>Thanks.
>
>

AddThis Social Bookmark Button