我試圖用Visual Studio 2012,MVC 4,C#和內置報告系統創建報告。我正在使用存儲過程來聯合和加入約13個表我知道這是我只是有一個大腦死亡的時刻,但因爲我想從一個存儲過程填充數組到一個ddl,我遇到問題以下錯誤:錯誤:參數1:無法從'int?[]'轉換爲'object'[
Argument 1: cannot convert from 'int?[]' to 'object[]'
下面是代碼:
public frm100percentQA()
{
InitializeComponent();
this.comboBox2.Visible = true;
this.comboBox2.Items.Clear();
List<Int32?> users = (from c in new NHISLINQ.NHISLINQDataContext().sp100PercentlQualityAssurance() where c.UserID != '0' select c.UserID).ToList();
this.comboBox2.Items.Add("<---Select UserID--->");
this.comboBox2.Items.Add("Select All");
this.comboBox2.Items.AddRange(users.ToArray());
this.comboBox2.SelectedIndex = 0;
}
我知道這可能是一個相當簡單的解決方案,但我畫一個空白,在這一點上。任何幫助?
你試過在查詢解析'c.UserID'到'int'?該錯誤表明,您的UserId不是一個類型整數在這一點和時間 – Marco