PDA

View Full Version : check null value from dataset


ebco
07-21-2003, 02:10 PM
//Bind to grid
Dropdownlist1.DataTextField="FTElocation";
Dropdownlist1.DataValueField="FTElocation";
Dropdownlist1.DataSource = ds;
Dropdownlist1.DataBind();
Dropdownlist1.Items.Insert(0,new ListItem("Select","-1"));


This is th way i am binding data to dropdownlist. Now i want to check whether the value. If it is null or empty i want to avoid it from binding.

intothemiddle
08-03-2003, 02:00 PM
You mean something that checks the datatype of the variable?

http://www.asp101.com/samples/viewasp.asp?file=var%5Ftypes%2Easp

That may be what youre on about? Hopefully :)

Intothemiddle

whammy
08-07-2003, 12:34 AM
Or you could use VarType(), if it's still supported. I haven't messed with .NET in a little while (too busy).