LINQ Replace DBNull with Blank String?

In your note you have mentioned IIf(row.isFirstNameNull(), "", row. FirstName) replace that with If(row.isFirstNameNull(), "", row. FirstName) which will not evaluate the false part if the condition is true.

First answer. Thanks all. – Steven Mar 10 '10 at 21:12.

Use VB's ternary operator "if" : Dim query = From row As myDataSet. MyDataRow in myDataSet. Tables("MyData") _ Select if(row.isFirstNameNull(), "", _ row.

FirstName), if(row.isLastNameNull(), "", row. LastName).

Works great for C# - not so much for VB.NET. VB. NET folks should use the If operator's coalesce form1: If(row.

FirstName, string. Empty). Of course, that doesn't work for this example either - since DbNull.

Value IsNot Nothing2. 1 msdn.microsoft. Com/en-us/library/bb513985.

Aspx 2 codebetter. Com/blogs/peter.van. Ooijen/archive/2004/04/12/… – Mark Brackett Mar 10 '10 at 21:21.

NOTE: Since the DataSet is strongly-typed. I can use row.isFirstNameNull(), but IIF(row.isFirstNameNull(), "", row.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions