日期:2014-05-17 浏览次数:20921 次
string place_class_sql = "select DISTINCT stringsub(car_fee_hostname,1,2) FROM car_park_fee where car_fee_flag = 2";现在报错"dl_fee_place.DisplayMember = "car_fee_hostname";"
string place_class_sql = "select DISTINCT car_fee_hostname FROM car_park_fee where car_fee_flag = 2"; SqlConnection place_conn = new SqlConnection(fee_conn.sql_conn()); DataSet complace = new DataSet(); place_conn.Open(); SqlDataAdapter myplace = new SqlDataAdapter(place_class_sql, class_conn); myplace.Fill(complace, "ds"); place_conn.Close(); DataRow dw = complace.Tables[0].NewRow(); dw["car_fee_hostname"] = "全部收费口"; complace.Tables[0].Rows.InsertAt(dw,0); dl_fee_place.DisplayMember = "car_fee_hostname"; this.dl_fee_place.DataSource = complace.Tables[0]; dl_fee_place.SelectedIndex = 0;
select distinct SUBSTRING(car_fee_hostname,1,3) as car_fee_hostname from