my の列にDataTable
null 値があります。このテーブルに を作成するときにDataView
、null 値を除外したいと考えています。どうすればいいですか?
私は自分のコードを次のように動作させました:
//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;