Linq to SQL and Gridview Datasource -
I have a question about which I do not want to do a computation, but I have a demonstration from a union Need to get value. In my C # code, I can reference the value directly, because the foreign key barrier generated Linux all the necessary stars. When I specify the IQueryable as Gridview Datasource property, and there is no column of primary unit in the reference set, then I get an error that the column does not exist. As a newbie for Linux, I'm guessing the assignment converts Ilistable into a list, and the association is lost. My question is, what is a good way to do this?
I think I can write a similar type of query around it by typing an anonymous type, which contains all the columns needed for Gridview. I think that by doing this, What I already have is what I already have. Can I ask in-memory data structures on the fly when I have a data source? Or is there a more direct solution?
Gridview Therapist is considered to display the medical group associations, and is in a lookup table on the name of the union.
IQueryable & lt; Physician & gt; PH = db.physicians in phys.PhysicianNames.DefaultIfEmpty () // in phys.PhysicianLicenseNums.DefaultIfEmpty () // in phys.PhysicianAddresses.DefaultIfEmpty () // Phys in Phys in the name of / from the name of LC from the NPI Phys.PhysicianMedGroups.DefaultIfEmpty .physicianNPIs.DefaultIfEmpty () // (from ASOC) Select phys.BQID == bqid phys;
So, based on Dennis's answer, I removed all the unnecessary stuff from my query. I thought I could not say to ask the right questions.
Anyway, the page shows the data of a doctor. I want to display all the medical group affiliations (and allow the user to insert, edit and update) in a grid. Now I realize that I do not need to be explicitly involved in these other tables - it does for me that I can use the license number, which is in a separate table, through a series of child organizations, By referring to I can not refer to the medical group name in Gridview, which brings me back to my question:
AffiliationGrid.DataSource = ph.first (). Physician Media Group; This does not work, because med_group_print_name is not accessible for GridView:
The property with a field or name 'med_group_print_name' was not found but was selected Data source Again, bear with me, if it's all very clear that I do not understand Linq ... because I do not.
Your query looks odd, you just have to do the dB physics
Should try to display from ph =. In physiotherapists where phys.BQID == bqid select phys; In your grid, this should work, besides why to load the call ()? If the datacentext is not settled when the grid is binding, then you do not need it.
If you still have problems, can you please post the received error message, which will be helpful ...
part 2
The problem It is not that your name is effectively in physics group. Since you have the property of that class, the name needs to be used to navigate down a level to MedGroupLookup.
Depending on the technology you are using (whether it is either WinForms or Web form), you have to configure your data-binding to access MedGroupLookup.med_group_print_name.
Comments
Post a Comment