Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NETVB.NET
Error is
Name IIf and DBNull are not declared
 
Code is
cmd.Parameters.Add("@address2", SqlDbType.VarChar).Value = IIf(Address2.Trim.Length > 0, Address2, DBNull.Value)
Posted 14 Nov '11 - 1:30
Edited 14 Nov '11 - 1:37

Comments
Manfred R. Bihy - 14 Nov '11 - 9:59
Please don't completely change your question. Now the solutions no longer fit the question. If you have a new question with new context please open up a separate post for that. Please change the question back to its original state and post a new question with the current content. Thanks for your cooperation!

4 solutions

add the line
Imports System.Configuration
  Permalink  
Comments
thatraja - 14 Nov '11 - 7:34
Both answers(Solution 1 & 2) posted at the same sec(27 secs) 5!
Pandya Anil - 14 Nov '11 - 7:44
tnx, nice observation :)
SAKryukov - 14 Nov '11 - 14:31
Same thing as you other answer, but this time it's correct as it does not mentioned adding a reference, which is completely different thing. So, this time I voted 5. --SA
You'll have to add a reference to System.Configuration as well as using the Imports keyword.
 
Cheers!
 
—MRB
  Permalink  
Comments
thatraja - 14 Nov '11 - 7:34
Both answers(Solution 1 & 2) posted at the same sec(27 secs) 5!
Manfred R. Bihy - 14 Nov '11 - 7:46
Thank you, man!
Please see my recent solution how to solve defined error[^].
 
And please avoid re-posting questions. Even though it's not re-post, you would not need one question if you know the answers to another one.
 
—SA
  Permalink  
i tried it, but i don't know why it is not working in my project.
i am using vs 2010 and today i have install vs 2012.
after installing vs 2012 i am facing this type of problem.
:(
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 425
1 OriginalGriff 315
2 Slacker007 240
3 Aarti Meswania 210
4 Maciej Los 200
0 Sergey Alexandrovich Kryukov 8,953
1 OriginalGriff 7,134
2 CPallini 3,758
3 Rohan Leuva 3,036
4 Maciej Los 2,488


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid