vb.net - Handling Trim on migration to .NET -


i have application has been migrated vb vb.net. in vb code trim function has been used on values database,in lots of places.as vb trim can propagate null no error thrown. when code migrated .net same trim functions are throwing errors doesn't support null propagation in .net.how can address issue on changing code in single place? tedious job if have use convert.tostring places. out of box suggession? databse db2

 sample:    vb:    res = trim(rs("name").value)     num = len(rs("name").value)     converted vb.net code    rs("name").trim()    rs("name").length   

dbnull.tostring returns empty string. global find/replace for

.trim(

to

.tostring().trim(


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -