Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > General > General Chat> convert vb to c#
 

Pages: 1
General Chat
convert vb to c#
Page:1/1 

  Print all messages in this thread  
Poster Message
ksk
User



Location:
Tamilnadu,India
Joined on:
06-Sep-2008 06:27:17
Posted:
2 posts
# Posted on: 08-Oct-2008 13:34:23.  
If Trim(entry.Value) = "" Then
entry.Value = Nothing
End If
Thanks & Regards,
Santhose kumar.K
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37870 posts
# Posted on: 08-Oct-2008 16:54:07.  
ksk wrote:
If Trim(entry.Value) = "" Then
entry.Value = Nothing
End If

Is this a test? Wink

if(entry.Value.Trim().Length<=0)
{
     entry.Value = null;
}

btw:
1) it's better not to use old VB5-6 native keywords like 'Trim'. Better use the .NET framework, so use the 'Trim' method on string
2) I personally don't think it's wise to use 'null' for string values, unless you absolutely have to.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
wtijsma
User



Location:
Amsterdam
Joined on:
18-Apr-2006 15:46:26
Posted:
252 posts
# Posted on: 13-Nov-2008 16:33:16.  
Otis wrote:

2) I personally don't think it's wise to use 'null' for string values, unless you absolutely have to.


Pff I couldn't agree more. string.Empty is the natural state of an empty string. Making System.String nullable is in my opinion the biggest mistake in the .Net framework design Regular Smiley

Same for people still using Guid.Empty and *.MinValue to instead of nullable types, and people that set all their database fields on nullable by default. The Horror Regular Smiley

- Wiebe
Wiebe Tijsma
http://www.netindustry.nl | http://www.twitter.com/wtijsma
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.