Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
277 Points
618 Posts
Aug 05, 2010 02:07 AM|LINK
How can i insert NULL value in db column from vb.net code behind sql query?
myCommand.CommandText = "UPDATE db_admin.tblContent " _ & "SET Headline='" & valHead & "', " _ & "Standfirst='" & valStandfirst & "'," _ & "Thumbnail='" & valThumbnail & "'," _ & "MainImage='" & valMainImage & "'," _ & "MetaDescription='" & valMetaDescription & "'," _ & "MetaKeyWords='" & valMetaKeyWords & "'," _ & "Article='" & valArticle & "'," _ & "URLTitle='NULL' " _ & "WHERE ContentID = " & qID myCommand.CommandText = "UPDATE db_admin.tblContent " _ & "SET Headline='" & valHead & "', " _ & "Standfirst='" & valStandfirst & "'," _ & "Thumbnail='" & valThumbnail & "'," _ & "MainImage='" & valMainImage & "'," _ & "MetaDescription='" & valMetaDescription & "'," _ & "MetaKeyWords='" & valMetaKeyWords & "'," _ & "Article='" & valArticle & "'," _ & "URLTitle='' " _ & "WHERE ContentID = " & qID
sheraz_aries
Member
277 Points
618 Posts
insert null value
Aug 05, 2010 02:07 AM|LINK
How can i insert NULL value in db column from vb.net code behind sql query?
myCommand.CommandText = "UPDATE db_admin.tblContent " _ & "SET Headline='" & valHead & "', " _ & "Standfirst='" & valStandfirst & "'," _ & "Thumbnail='" & valThumbnail & "'," _ & "MainImage='" & valMainImage & "'," _ & "MetaDescription='" & valMetaDescription & "'," _ & "MetaKeyWords='" & valMetaKeyWords & "'," _ & "Article='" & valArticle & "'," _ & "URLTitle='NULL' " _ & "WHERE ContentID = " & qID myCommand.CommandText = "UPDATE db_admin.tblContent " _ & "SET Headline='" & valHead & "', " _ & "Standfirst='" & valStandfirst & "'," _ & "Thumbnail='" & valThumbnail & "'," _ & "MainImage='" & valMainImage & "'," _ & "MetaDescription='" & valMetaDescription & "'," _ & "MetaKeyWords='" & valMetaKeyWords & "'," _ & "Article='" & valArticle & "'," _ & "URLTitle='' " _ & "WHERE ContentID = " & qIDI tried the queries above but one leave the cell empty while other leave the cell will string 'NULL' but its not the null you get when you manually type NULL by opening the table in edit mode.