473,378 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Send Null Value image field

How can i send from VB 2005 a null value to a image field on a database in
SQL 2005
Aug 17 '07 #1
4 6783
On Aug 17, 10:58 am, "Laurahn" <leme...@newsgroups.nospamwrote:
How can i send from VB 2005 a null value to a image field on a database in
SQL 2005
I believe you can send DbNull.Value.


Seth Rowe

Aug 17 '07 #2
"Laurahn" <le*****@newsgroups.nospamschrieb:
How can i send from VB 2005 a null value to a image field on a database in
SQL 2005
Did you already try 'DBNull.Value' as the field's value?

M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 17 '07 #3
I've tried with system.bdnull.value already, but i got this error:
a "System.DBNull" cannot be convert in '1 -dimensional Byte'

I'm working with "system.byte()"

"Laurahn" <le*****@newsgroups.nospamescribió en el mensaje
How can i send from VB 2005 a null value to a image field on a database in
SQL 2005

Aug 17 '07 #4
Hi Laurahn,

I agree with what Herfried and Seth have suggested. We could set the image
field to DBNull.Value to save Null value in the corresponding field in the

I will illustrate this with a sample.

I Create a DataSet called 'DataSet1' in a WinForm project and drag a table
named 'Student' from the Server Explorer onto the DataSet1 designer. A
DataTableAdapter named 'StudentDataAdapter' is generated by the designer
automatically. The image field in the Student table is 'pic'.

The following code updates the 'pic' field of the first row to a Null value:

DataSet1.StudentDataTable dt = new DataSet1.StudentDataTable();
DataSet1TableAdapters.StudentTableAdapter ta = new
TestProject.DataSet1TableAdapters.StudentTableAdap ter();
dt.Rows[0]["pic"] = DBNull.Value;

Hope this helps.
If you have any question, please feel free to let me know.

Linda Liu
Microsoft Online Community Support

Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Roger Withnell | last post by:
I'm updating a record by opening a recordset, setting the fields and the updating it with objRS.Update. I need to set an image datatype to NULL. objRS("field") = NULL works for datatypes int...
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
by: exxos | last post by:
HI all, This has had me confuzzeled for a while now, I've read countless threads on such errors and it seems to be down to the way things are set out and loaded. Can anyone suggest why this...
by: Robb Gilmore | last post by:
Hello, We have a C#.NET app which is calling a Java webservice. We use the wsdl file exportted from the java webservice to create our web-reference in Visual Studio. We are able to create the...
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
by: Matt | last post by:
I could use some help dealing with null blobs. I'm returning a transaction from an Image BLOB field in SQL Server 2000 using C#. If the transaction exists the value is returned with out trouble,...
by: AAVarda | last post by:
Hi, I have a device that scan's a doc and send's the doc image back. Below is the function in API to get the Image: ULONG MTMICRGetImage ( char *pcDevName, char *pcImageID, char *pcBuffer,...
by: Learner | last post by:
Hello, I have database field called 'PullAHead' defined as a bit field. Now if user doesn't pick a 'Yes' or 'No' in the front I need to be able to send a null value into the 'PullAHead' field in...
by: Sinister747 | last post by:
Hi All, I have been spending all night and a large portion of today trying to fix this error, and this is all because i have limited knowledge of javascript. This is my first post on IT Bytes...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.