(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.ShortChar01).DefaultIfEmpty("").FirstOrDefault()
Change the fields to meet your needs. Right now it returns ShortChar01 from Part and assigns it to ShortChar01 on the OrderDtl.
Thanks for the quick feedback. One thing I forgot to mention is that the users want the flexibility to modify the text field thatâs being copied over. Iâve tried the Foreign Key View, but the fields are defaulted to DataReadOnly âTrueâ with no options to change to false.
I wasnât able to locate ChangePartNumMaster method in Part, but there was a ChangePartNum. Iâm not sure if thatâs what youâre referring to, but I went ahead with that method, the problem is it doesnât have an option to set the ttOrderDtl table.
This may be a simple brain fart from my end, but using your code, I keep running into the error below.
System.Drawing.Bitmap CS1061 âPartâ does not contain a definition for âShortChar01â and no extension method âShortChar01â accepting a first argument of type âPartâ could be found (are you missing a using directive or an assembly reference?)
I am having the same error and I tried with no success:
(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.ShortChar01).DefaultIfEmpty("").FirstOrDefault()
&
(from x in Db.Part where x.Company == ttOrderDtlRow.Company && x.PartNum == ttOrderDtlRow.PartNum select x.Shortchar01).DefaultIfEmpty("").FirstOrDefault()