且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到表0,systemINdexOutOfrange异常

更新时间:2022-03-23 19:39:08

看我打破你的状况

See i am breaking your condition
if ( ds!=null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)

to

to

if ( ds!=null && ds.Tables.Count > 0 )  if(ds.Tables[0].Rows.Count > 0) {
 
                   foreach (DataRow drow in ds.Tables[0].Rows)
                   {  
                       UserProfile user = new UserProfile();
                       user.FatherQualification = Convert.ToString(drow["Name"]);
                       user.pkFatherQualificationId = Convert.ToInt32(drow["pkQualificationId"]);
                       UserPRofileDc.Add(user);
 
                   }
               }