I Need A Query Sample

Joined
Aug 6, 2005
Messages
5
Programming Experience
Beginner
Dear friends

i have a database which has a lot of columns and unfortunately all columns has a some null input.

Database has a lot of columns and it is not easy to write in where criteria all field.

I need if is possible a query like this all of in database table which data is null change it with "NO INPUT" string.

If i can take your valuable advice(s) i will be very glad.

Thanks a lot
 
You have a lot choices available. For instance, you can make custom controls by inheriting and adding a new Property (say NullableValue).
To make this control work against a table with null values you would need some code i.e.
VB.NET:
{...}
Set(ByVal Value As Object)             
If IsDBNull(Value) Then                 
MyBase.Text = "NO INPUT"             
Else                 
MyBase.Value = Value              
End If         
End Set     
End Property
This is how you can make it easier for the next time you deal with a table with null values. Otherwise you can simply check the value/s each time you fetch a data i.e.
VB.NET:
If cmd.ExecuteScalar is DBNull.Value then 'btw, checking DBNull value instead isDBNull will increase a performance of your app
myText.text = "NO INPUT"
Else
myText.text = cmd.ExecuteScalar
End if
Regards ;)
 
Back
Top