Ohne null-Werte in DataView

In einer Spalte meiner DataTable sind null-Werte. Wenn ich ein DataView auf diese Tabelle, ich möchte herausfiltern, die null-Werte. Wie mache ich das?

Ich habe mein code funktioniert dies so:

//get the cities and a view on the data
DataTable dtPlaatsen = client.getCities();
DataView dvPlaatsen = dtPlaatsen.DefaultView;

//filter and sort the view
dvPlaatsen.RowFilter= "Isnull(Plaatsnaam,'Null Column') <> 'Null Column'"; 
dvPlaatsen.Sort = "Plaatsnaam";


//attach the view as datasource
ddlCities.DataSource = dvPlaatsen;
ddlCities.DataTextField = "Plaatsnaam"; //the field to display to the user
ddlCities.DataValueField = "PlaatsId"; //the field which is send

ddlCities.DataBind();

ddlCities.SelectedIndex = 50;
verwenden Sie Ihre dataview rowfilter

InformationsquelleAutor jorrebor | 2012-10-25

Schreibe einen Kommentar