我有這個查詢,我期待着很多結果。將每個查詢結果作爲內容插入到組合框中
private void addContentInCmbPhy() {
DbClassesDataContext myDb = new DbClassesDataContext(dbPath);
var match = from phy in myDb.Physicians
select phy.Phy_FName;
for(IQueryable<string> phy in match){
cmbPhysicians.Items.Add(phy);
}
}
在我的查詢它上面將返回幾個結果,我想那些名結果被插入在我的組合框的項目,我會怎麼加呢?它給了我這個下面的錯誤
Error 7 Only assignment, call, increment, decrement, and new object expressions can be used as a statement C:\Users\John\documents\visual studio 2010\Projects\PatientAdministration\PatientAdministration\Pat_Demog.cs 415 43 PatientAdministration
Error 8 ; expected C:\Users\John\documents\visual studio 2010\Projects\PatientAdministration\PatientAdministration\Pat_Demog.cs 415 40 PatientAdministration
Error 9 ; expected C:\Users\John\documents\visual studio 2010\Projects\PatientAdministration\PatientAdministration\Pat_Demog.cs 415 43 PatientAdministration
我的猜測是,你沒有顯示有錯誤的代碼。我看不到任何缺少的分號。 – usr 2012-03-31 13:42:32
你在使用linq sql嗎? – Milee 2012-03-31 13:42:42