Hi all,

I am trying to use System.Data.ODBC to insert a file into a binary field in
SQL Server 2000. Now, before you yell at me, the reason I am doing this is
that I am only writing intitial code against SQL, but this app will need to
be able to run against any ODBC compliant DB, so I am also not using stored
procedures.

I have tangles with this for hours, but I cannot seem to figure out how to
just read the contents of a file off disk and write it into a binary field in
SQL not using a stored procedure. If I can get that working, I can do
whatever I need, but I can't so far.

Does anyone have a sample of this or an article? There are many articles for
doing this with SPROCS, doing this with SqlClient, not ODBC. I tried just
modifying the objects from an SqlClient example, but no avail.

Appreciate any help on this...

Re: Insert BLOB problem by Cor

Cor
Sat Nov 26 11:31:27 CST 2005

Chris,

This sample describes the complete handling of an image using a
dataset/datatable.

If you than update that dataset/datatable to the database using ODBC or
whatever is than not important anymore

http://www.vb-tips.com/default.aspx?ID=0bf3f72d-b722-459d-8a46-38b5a2f7fdf0

I hope this helps,

Cor

"Chris" <Chris@discussions.microsoft.com> schreef in bericht
news:20FF9C28-EC77-4FAE-A590-3737CB48A89D@microsoft.com...
> Hi all,
>
> I am trying to use System.Data.ODBC to insert a file into a binary field
> in
> SQL Server 2000. Now, before you yell at me, the reason I am doing this
> is
> that I am only writing intitial code against SQL, but this app will need
> to
> be able to run against any ODBC compliant DB, so I am also not using
> stored
> procedures.
>
> I have tangles with this for hours, but I cannot seem to figure out how to
> just read the contents of a file off disk and write it into a binary field
> in
> SQL not using a stored procedure. If I can get that working, I can do
> whatever I need, but I can't so far.
>
> Does anyone have a sample of this or an article? There are many articles
> for
> doing this with SPROCS, doing this with SqlClient, not ODBC. I tried just
> modifying the objects from an SqlClient example, but no avail.
>
> Appreciate any help on this...
>