窗体继承的问题。在线急救!
我在窗体(UserTemplet )的load里给两个combobox(分别为cbbgroup,cbbdepartment)赋了值。
public partial class UserTemplet : Form
{
public SqlDataAdapter da = null;
public DataSet ds = null;
public DataTable dt = null;
public UserTemplet()
{
InitializeComponent();
}
private void UserTemplet_Load(object sender, EventArgs e)
{
da = new SqlDataAdapter( "select * from departments where tag = 1;select * from groups where tag =1 ", DB.conn);
ds = new DataSet();
dt = new DataTable();
da.Fill(ds);
dt = ds.Tables[0];
cbbDepartment.DataSource = dt;
cbbDepartment.DisplayMember = "AName ";