DB.connection.Open();
DataSet dataset = new DataSet();
SqlDataAdapter dataadapter = new SqlDataAdapter(sql3, DB.connection);
dataadapter.Fill(dataset, "Goods");
DataRow newRow = dataset.Tables["Goods"].NewRow();//声明数据新的数据行
newRow["type"] = "全部"; //为数据行type字段添加值
dataset.Tables["Goods"].Rows.InsertAt(newRow, 0);//插入新行到表中
comboBox2.DataSource = dataset.Tables["Goods"];
comboBox2.DisplayMember = dataset.Tables["Goods"].Columns["type"].ColumnName;
combobox控件添加数据源列表后再添加自定义字段
最新推荐文章于 2024-08-24 11:08:38 发布