我有一個members
表列加入使用lambda表達式和檢索數據
member_Id,
member_Lastname,
member_Firstname,
member_Postcode,
member_Reference,
member_CardNum,
和我有另一個表mshipoptions
的列
mshipoption_id
mshiptype_id
和我有另一個表mshiptypes
mshiptype_id
mshiptype_name
另一張表memtomship
memtomship_id
mshipoption_id
member_id
和我的實體名稱是eclipse
在形式負載我正在通過使用下面的方法填充數據網格視圖....
private void reportmembers()
{
MemberControlHelper.Fillmembershiptypes(cbGEMembershiptype);
var membersreport = from tsgentity in eclipse.members
join memtomships in eclipse.membertomships on tsgentity.member_Id equals memtomships.member_Id
join mshipoptiions in eclipse.mshipoptions on memtomships.mshipOption_Id equals mshipoptiions.mshipOption_Id
join mshiptypes in eclipse.mshiptypes on mshipoptiions.mshipType_Id equals mshiptypes.mshipType_Id
select
new {
tsgentity.member_Id,
tsgentity.member_Lastname,
tsgentity.member_Firstname,
tsgentity.member_Postcode,
tsgentity.member_Reference,
tsgentity.member_CardNum,
mshiptypes.mshipType_Name,
};
if (txtfirstname.Text != "")
{
dgvmembersrep.DataSource = membersreport.Where(t => t.member_Firstname == txtlastname.Text).ToList();
}
if (txtcardnum.Text != "")
{
dgvmembersrep.DataSource = membersreport.Where(a => a.member_CardNum == txtcardnum.Text).ToList();
}
}
,這是細,.. 。
我的問題就在這裏,我有一個comboboxsay(cbgemembershiptype)......
當用戶選擇會員類型(cbgemembershiptype)時,我想檢索那些具有該會員類型的會員的詳細信息....
請參閱http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts/ –