Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 null value to image field

Author  Topic 

muthukumar.csm
Starting Member

18 Posts

Posted - 2009-01-12 : 04:32:35
how to insert empty value to image datatype column.assume that column wont allow null .

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-12 : 04:42:10
create table tt(it int ,id image not null)

insert into tt select 1,''
select * from tt

o/p as
1 0x
u can insert the '' (empty string)
Go to Top of Page

muthukumar.csm
Starting Member

18 Posts

Posted - 2009-01-12 : 21:10:43
Thanks to you.i need to insert this empty value from code behind.i dont know how to declare 0x.Is any other way?Thanks 4 reply
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-13 : 00:13:03
quote:
Originally posted by muthukumar.csm

Thanks to you.i need to insert this empty value from code behind.i dont know how to declare 0x.Is any other way?Thanks 4 reply


whats the front end you're using?
Go to Top of Page

muthukumar.csm
Starting Member

18 Posts

Posted - 2009-01-13 : 00:35:21
asp.net 3.5 with c#
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-13 : 03:13:22
try string.empty
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-01-13 : 03:28:49
quote:
Originally posted by muthukumar.csm

asp.net 3.5 with c#


You may need to post this in .NET relate forum

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

hammad12
Starting Member

1 Post

Posted - 2009-02-19 : 01:25:38
quote:
Originally posted by muthukumar.csm

Thanks to you.i need to insert this empty value from code behind.i dont know how to declare 0x.Is any other way?Thanks 4 reply


Its easy just make a Byte[] bArray; and assign it nothing... issue will be solved. I am using this way:

byte[] byteImageArray;
byteImageArray = new byte[Convert.ToInt32(filLength)];

whenever filLength is zero, it will create the same 0x thing and your problem will be solved..
Go to Top of Page
   

- Advertisement -