这段代码,第二个datareader 读取不到数据 private void product_Load(object sender, EventArgs e)
{
this.CenterToScreen();
Means mymeans = new Means();
SqlDataReader sdr_1 = mymeans.getDataReader(@"select top 1 num from product order by id desc");
string num = "";
while (sdr_1.Read())
{
num = sdr_1.GetString(0);
}
int i = Convert.ToInt32(num) + 1;
txtnum.Text = i.ToString();
sdr_1.Dispose();
sdr_1.Close();
SqlDataReader sdr_2 = mymeans.getDataReader(@"select name from frim");
while (sdr_2.Read())
{
cbofrim.Items.Add(sdr_2[0].ToString());
}
sdr_2.Dispose();
sdr_2.Close();