Convert NULL to EMPTY string
Posted on 2007-11-19
I am using an SQL database in my ASP.NET application. I want to edit/insert new entries to the database using detailsview control. I might not enter information into all the fields, for example I might have a record only with FirtsName, but no LastName and no Phone. For the purpose of searching the database later I do not allow NULL as a field entry. Obviously, when I am trying to insert/edit a record with some empty fields I have an error. How can I convert NULL type data fields from detailsview into EMPTY strings before writing data to the SQL database? Thank you.