日期:2014-05-17 浏览次数:20819 次
myConn = new SqlConnection(myConnStr); myConn.Open(); String myCmdStr_MemberName = "Select memberID,classID From tbMember Order By memberID"; SqlCommand myCMD_MemberName = new SqlCommand(myCmdStr_MemberName,myConn); SqlDataReader myDR_MemberName = myCMD_MemberName.ExecuteReader(); while (myDR_MemberName.Read()) { if (myDR_MemberName.GetString(1) == "JXJX" || myDR_MemberName.GetString(1) == "WFWF") { this.comB_MateName.Items.Add(myDR_MemberName.GetString(0)); this.comB_MateName.ValueMember = "GD"; } else if (myDR_MemberName.GetString(1) == "ZHZH") { this.comB_MateName.Items.Add(myDR_MemberName.GetString(0)); this.comB_MateName.ValueMember = "BKBK"; } else { this.comB_MateName.Items.Add(myDR_MemberName.GetString(0)); this.comB_MateName.ValueMember = "JDJD"; } } myDR_MemberName.Close(); myConn.Close();