?
Solved

1 line code for this 4 lines

Posted on 2005-05-07
5
Medium Priority
?
250 Views
Last Modified: 2011-04-14
I need a funcional code con IIF fro this

If txtkilosProv.Text <> "" Then
                        dr.KgsPro = txtkilosProv.Text
                    Else
                        dr.SetKgsProNull()
                    End If

thanks
0
Comment
Question by:miguelmam
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:rodmjay
ID: 13950042
iif(txtkilosprov.text <> "", dr.kgspro = txtkilosprov.text, dr.setkgspronull())
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 375 total points
ID: 13950138
Don't think that iif version performs faster. It performs exactly like if version and, in this case, it is hardly understandable. Possibly it's better to write:

dr.KgsPro = iif (txtkilosProv.Text <> "", txtkilosProv.Text, null)

but your initial version is quite good.
0
 
LVL 8

Expert Comment

by:rodmjay
ID: 13950158
Yeah, I would have to agree
0
 

Author Comment

by:miguelmam
ID: 13950428
Not for performs only by stetic :-)

I have a error: Null is not valid for tables.


 
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 13950612
I don't know what happens in SetKgsProNull function, just do the same in iif line.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question