日期:2014-05-19  浏览次数:20788 次

急求高手
if   (textBox1.Text   !=   " ")
                        {
                                DataSet   ds=new   DataSet();
                                SqlDataAdapter   da=new   SqlDataAdapter(sqlstr,myconn);
                                db.Close();
                                da.Fill(ds, "门诊挂号 ");
                                SqlCommandBuilder   ba   =   new   SqlCommandBuilder(da);
                                for   (int   i   =   0;   i   <   ds.Tables[ "门诊挂号 "].Rows.Count;   i++)
                                {
                                        if   (textBox1.Text   ==   ds.Tables[ "门诊挂号 "].Rows[i][ "id "].ToString())
                                        {
                                                no   =   i;
                                                break;
                                        }
                                }
                                textBox2.Text   =   ds.Tables[ "门诊挂号 "].Rows[no][ "科室 "].ToString();
                                textBox3.Text   =   ds.Tables[ "门诊挂号 "].Rows[no][ "类别 "].ToString();
                                textBox4.Text   =   ds.Tables[ "门诊挂号 "].Rows[no][ "费用 "].ToString();
                                textBox5.Text   =   ds.Tables[ "门诊挂号 "].Rows[no][ "挂号时间 "].ToString();