winforms - Windows Form not changing underlying Entity Data -
can see simple mistake can't?
i opening form allow assigning job numbers invoices not have any.
this code in applications main form handles this:
dim unknownjobs = pur in context.purchases pur.senttomyob = false andalso pur.job.jobnumber = string.empty select pur if unknownjobs.any frmjobs2.jobsbindingsource.datasource = (from j in context.jobs1 order j.jobnumber select j).tolist frmjobs2.purchasesbindingsource.datasource = unknownjobs progress.hide() if frmjobs2.showdialog = windows.forms.dialogresult.ok context.savechanges() end if end if
this form gets opened relevant column details displayed
the code behind simple , consists of:
public class formjobs2 ''' <summary> ''' ok clicked ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> private sub okbutton_click(sender system.object, e system.eventargs) handles okbutton.click me.dialogresult = windows.forms.dialogresult.ok me.close() end sub ''' <summary> ''' cancel clicked ''' </summary> ''' <param name="sender"></param> ''' <param name="e"></param> ''' <remarks></remarks> private sub skipbutton_click(sender system.object, e system.eventargs) handles skipbutton.click me.dialogresult = windows.forms.dialogresult.cancel me.close() end sub end class
what happens when runs can select job numbers not display on datagridview , not update underlying context.
where stupid mistake, please?
it appears if trying assign frmjobs2.purchasesbindingsource.datasource
iqueryable.
the line should read:
frmjobs2.purchasesbindingsource.datasource = unknownjobs.tolist
Comments
Post a Comment