Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding Null to a column

Reply
Thread Tools

Adding Null to a column

 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      03-18-2005
I'm trying to add NULL to a column in the database but the sql below
isn't updating?

if (name=="")
{
strCmd += "UPDATE";
strCmd += " EMPLOYEEDETAILS SET ";
strCmd+= "name='"+null+"',designation='"+desg+"',sex='"+sex +"'
,age="+age+" , salary="+salary+" where id="+id;
}




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Jignesh Desai
Guest
Posts: n/a
 
      03-18-2005
Update TableName Set Column1 = null (No quotes)

HTH
Regards,
Jignesh Desai
www.dotnetjini.com
"Patrick Olurotimi Ige" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'm trying to add NULL to a column in the database but the sql below
> isn't updating?
>
> if (name=="")
> {
> strCmd += "UPDATE";
> strCmd += " EMPLOYEEDETAILS SET ";
> strCmd+= "name='"+null+"',designation='"+desg+"',sex='"+sex +"'
> ,age="+age+" , salary="+salary+" where id="+id;
> }
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      03-18-2005
Hi Patrick,

Use NULL without single quotation mark, e.g. SET name =
NULL .

HTH

Elton Wang
http://www.velocityreviews.com/forums/(E-Mail Removed)

>-----Original Message-----
>I'm trying to add NULL to a column in the database but

the sql below
>isn't updating?
>
>if (name=="")
>{
>strCmd += "UPDATE";
>strCmd += " EMPLOYEEDETAILS SET ";
>strCmd+= "name='"+null+"',designation='"+desg+"',sex='" +se

x+"'
>,age="+age+" , salary="+salary+" where id="+id;
>}
>
>
>
>
>*** Sent via Developersdex http://www.developersdex.com

***
>Don't just participate in USENET...get rewarded for it!
>.
>

 
Reply With Quote
 
Tampa.NET Koder
Guest
Posts: n/a
 
      03-18-2005
Patrick,

Please try not to double post. If you looked at the post you made earlier
today at 1:53am then you would have gotten the answer to your question.



"Patrick Olurotimi Ige" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'm trying to add NULL to a column in the database but the sql below
> isn't updating?
>
> if (name=="")
> {
> strCmd += "UPDATE";
> strCmd += " EMPLOYEEDETAILS SET ";
> strCmd+= "name='"+null+"',designation='"+desg+"',sex='"+sex +"'
> ,age="+age+" , salary="+salary+" where id="+id;
> }
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
difference between null object and null string gokul.b@gmail.com Java 16 10-12-2005 06:43 PM
VB.NET Null to SQL Null (ASP.NET 2.0 GridView) Kivak Wolf ASP .Net 2 06-28-2005 02:01 PM
Is there a null ostream (like /dev/null) in cpp? Bo Peng C++ 13 07-18-2004 07:17 PM



Advertisments