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

未将对象引用设置到对象的实例
private   void   ReturnUserData(int   iRet)
                {
                        string   strSQL   =   " ";
                        LinkDataBase   link   =   new   LinkDataBase();
                        DataSet   ds   =   new   DataSet();
                        DataTable   dt;
                        if   (iRet   !=   0)
                        {
                                strSQL   =   "select   *   from   SysUser   where   SysUserID   =   ' "   +   iRet   +   " ' ";
                        }
                        ds   =   link.SelectDB(strSQL);
                        if   (ds.Tables[0].Rows.Count   >   0)
                        {
                                dt   =   ds.Tables[0];
                                this.textBox1.Text   =   dt.Rows[0][ "SysUserCode "].ToString();
                                this.textBox2.Text   =   dt.Rows[0][ "SysUserName "].ToString();
                                this.textBox3.Text   =   dt.Rows[0][ "Psw "].ToString();
                                this.textBox4.Text   =   dt.Rows[0][ "Email "].ToString();
                                this.textBox5.Text   =   dt.Rows[0][ "Tel "].ToString();
                                this.textBox6.Text   =   dt.Rows[0][ "Address "].ToString();
                                this.comboBox1.Text   =   dt.Rows[0][ "DeptID "].ToString();
                                this.comboBox2.Text   =   dt.Rows[0][ "Sex "].ToString();
                        }
                }