C# OLE DB sample?

G

Guest

Hello everyone,


I am learning how to use C# to implement an OLE DB provider (a simple one
which is based on CSV file format). I can not find any samples from MSDN (all
samples are C++).

Any reference materials?


thanks in advance,
George
 
G

Guest

Hi Mark,


Maybe I have not make my question clear. I have not seen any relationship
between your reply and my question.

What you provide is how to use OLE DB provider (as an OLE DB consumer), but
what I am looking for is how to implement OLE DB provider, here is the
related sample in C++,

http://msdn2.microsoft.com/en-us/library/ms715011.aspx

I am looking for a C# sample.


regards,
George
 
N

Nicholas Paldino [.NET/C# MVP]

The question was clear enough, as was the answer. Mark was trying to
see what the basis for the question was, thinking that you might be trying
to do this because you need a provider for OLE DB to work with CSV files.
Since you didn't specify either way what your reasoning for wanting to do
this when there is already something in place (for example, as a learning
exercise), Mark made a (IMO valid) guess as to what you were trying to do.

That being said, there is no sample in C# to create a custom OLE DB
provider. You can use the C++ sample, and convert it to C#, but be warned,
it is not a direct conversion, and will require a good amount of retooling
and interop (but it IS possible).
 
M

Mark Rae [MVP]

Maybe I have not make my question clear. I have not seen any relationship
between your reply and my question.

What you provide is how to use OLE DB provider (as an OLE DB consumer),
but
what I am looking for is how to implement OLE DB provider

Following on from Nicholas' reply, I was simply wondering whether you
thought you needed to write your own OleDb provider for CSV files because
you didn't know that Microsoft already provide one...

However, if you want to do this for your own education, that's a different
matter... :)
 
G

Guest

Thanks for your advice, Nicholas!


Do you know any tools to convert C++ code to C#?


regards,
George

Nicholas Paldino said:
The question was clear enough, as was the answer. Mark was trying to
see what the basis for the question was, thinking that you might be trying
to do this because you need a provider for OLE DB to work with CSV files.
Since you didn't specify either way what your reasoning for wanting to do
this when there is already something in place (for example, as a learning
exercise), Mark made a (IMO valid) guess as to what you were trying to do.

That being said, there is no sample in C# to create a custom OLE DB
provider. You can use the C++ sample, and convert it to C#, but be warned,
it is not a direct conversion, and will require a good amount of retooling
and interop (but it IS possible).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

George said:
Hi Mark,


Maybe I have not make my question clear. I have not seen any relationship
between your reply and my question.

What you provide is how to use OLE DB provider (as an OLE DB consumer),
but
what I am looking for is how to implement OLE DB provider, here is the
related sample in C++,

http://msdn2.microsoft.com/en-us/library/ms715011.aspx

I am looking for a C# sample.


regards,
George
 
G

Guest

Hi Mark,


I am interested in database technology and I want to learn by myself in
depth, so that I could offer some consulting for other people. I think to
learn OLE DB, we should not only know how to use it (there are a lot of
samples) and know how it is implemented internally.

Any reference materials?

regards,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top