من یه ویو دارم به نام PatientSymptoms و وقتی میخوام توی دیتا گرید ویو بذارمش ارور میده کد رو پایین مینویسم ممنون میشم ایردشو بگید:
dgvNewVisitSymptoms.DataSource = se.PatientSymptoms.Where(x => x.PatientID == searchID);
ارورشم که میده اینه :
System.NotSupportedException was unhandled HResult=-2146233067 Message=Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported. Instead populate a DbSet with data, for example by calling Load on the DbSet, and then bind to local data. For WPF bind to DbSet.Local. For WinForms bind to DbSet.Local.ToBindingList(). Source=EntityFramework StackTrace: at System.Data.Entity.Infrastructure.DbQuery`1.System.ComponentModel.IListSource.GetList() at System.Windows.Forms.CurrencyManager.SetDataSource(Object dataSource) at System.Windows.Forms.CurrencyManager..ctor(Object dataSource) at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember) at System.Windows.Forms.BindingContext.get_Item(Object dataSource, String dataMember) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.SetDataConnection(Object dataSource, String dataMember) at System.Windows.Forms.DataGridView.set_DataSource(Object value) at Sepanta4.frmMain.txtNewVisitID_TextChanged(Object sender, EventArgs e) in c:\Users\Hooman\Documents\Visual Studio 2012\Projects\DXApplication2\Sepanta4\Form1.cs:line 776 at System.Windows.Forms.Control.OnTextChanged(EventArgs e) at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e) at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m) at System.Windows.Forms.TextBoxBase.WndProc(Message& m) at System.Windows.Forms.TextBox.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:
این پست در تاریخ {{ dateString(new Date(post.deleteDate)) }} توسط {{ post.deletedByUser }} حذف شده است.
دلیل حذف: {{ post.deleteReason ?? 'نامشخص' }}
زمان پاسخ گویی روز های شنبه الی چهارشنبه ساعت 9 الی 18
فقط به موضوعات مربوط به محصولات آموزشی و فروش پاسخ داده می شود