Is it Posible Access VarBinary(MAX) From SqlDbType.Image

I

Irakli Lomidze

Dear Sirs.

I have question a about BLOB Fields on SQL Database.

My Hisotry
I have .NET 1.1 Application on SQL 2000 that use ntext,Image Data Types.
After I have Update Application to .NET 2.0 and SQL 2005. I Dont Change
Database Structure During Update.

Now I need to Update My ntext,Image fileds to nVarChar(MAX) and VarBinary(MAX)
(Because i need to use this fields in Triggers for creating Table Hisotry)

What should I do:

1) Is it Enaug just change Data Type of ntext and image Fields ?

2) My Application Code use SqlDbType.Image and SqlDbType.ntext
Will SqlDbType.Image works fine with VarBinary(MAX)
and SqlDbType.ntext with nVarChar(MAX)
Or I need to Rewite my .NET Application Code ?


Thank you in Advance.
 
F

Frans Bouma [C# MVP]

Irakli said:
Dear Sirs.

I have question a about BLOB Fields on SQL Database.

My Hisotry
I have .NET 1.1 Application on SQL 2000 that use ntext,Image Data Types.
After I have Update Application to .NET 2.0 and SQL 2005. I Dont Change
Database Structure During Update.

Now I need to Update My ntext,Image fileds to nVarChar(MAX) and VarBinary(MAX)
(Because i need to use this fields in Triggers for creating Table Hisotry)

What should I do:

1) Is it Enaug just change Data Type of ntext and image Fields ?

2) My Application Code use SqlDbType.Image and SqlDbType.ntext
Will SqlDbType.Image works fine with VarBinary(MAX)
and SqlDbType.ntext with nVarChar(MAX)
Or I need to Rewite my .NET Application Code ?

You need to change the types on the parameters, however the code
working with the data doesn't have to change, as both types (image and
varbinary()) are mapped to byte[]

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 

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