I am working on a program to manipulate data from a MS SQL 2000 database. However, I am having problems differentiating between nulls and empty strings, both of which I find in my database. I would like to covert all the nulls returned by my SQL query into blank strings to make data checking easier later on.
Here is the code that gathers the data:
I have a bunch of If-Then statements to act if the data is not null. For example:
But if the SSN field is null instead of blank, I get errors. I would prefer not to check for nulls & blanks each time; but instead coverting them all to blanks.
Here is the code that gathers the data:
Code:
Dim cmd As New SqlCommand("Select * From ClientTable", IntakeConnection)
Dim IntakeData As SqlDataReader = cmd.ExecuteReader()
I have a bunch of If-Then statements to act if the data is not null. For example:
Code:
If IntakeData.Item("SSN") <> "" Then XML.WriteElementString("soc_sec_no", IntakeData.Item("SSN"))
But if the SSN field is null instead of blank, I get errors. I would prefer not to check for nulls & blanks each time; but instead coverting them all to blanks.