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
Post a Comment