View Complete Post
Hi
First I am newbie using EF - so sorry on this basic question
I have a Project Table that relate to Company Table
When I Map with EF I Do not have property of CompanyId in the Project Object
But I have related Company Object
For example
Project p = new Project();
p.CompanyId è does not exist!
When I try addingit myself I get this error:
If I need just the Company id, and I don't want get it like
p.Company.CompanyId - because than the application try connect again to the DB and I don't want this, because I need just the CompanyId.
What the best regular way to get it?
Thanks
I have a data modeling question that hopefully this fictious example will help explain. My application is data driven and the classes reflect the tables to a large degree. In this example my database has two tables:
The VendorContact table also has a Foreign Key of VendorID in order to associate the contact with a specific Vendor. In this example a Vendor can only have one contact.
My question is how to represent these two tables in terms of classes. In my current design I have two classes:
In order to represent the relationship between a VendorMaster and VendorContact, my VendorMaster class contains a property called VendorContact.
My questions are about the VendorContact class and how it represents the relationship between a VendorMaster and itself.
Option #1
The VendorContact class should contain an int property of VendorID
Option #2
The VendorContact class should contain a VendorMaster Property
I am not sure which option is the 'best' option to take. My concern is that if I go with option #2 that I would create a cyclical relationship between the VendorMaster and Vendo
Im using the the below query as the condition for a Drillthrough Action
IIF([Load Date].[LoadDate].CURRENTMEMBER IS [Load Date].[LoadDate].LastChild, TRUE, FALSE)
I am attempting to confine this action to the last loaddate member. I'm thinking this is fairly easy to do, but I cannot seem to get it to work. I haven't been doing MDX for a couple years now so I'm probably missing something simple...? Thanks for any assistance.
Simple SqlDataReader question Do I only need to close the datareader on mydr.Read() or also when I Execute the SqlDataReader without using mydr.Read()? Would this Close in the following example be unnecessary?Using mydr As SqlDataReader = mycmd.ExecuteReader() mydr.Close() End Using Thanks in advance..
Do I only need to close the datareader on mydr.Read() or also when I Execute the SqlDataReader without using mydr.Read()? Would this Close in the following example be unnecessary?
Using mydr As SqlDataReader = mycmd.ExecuteReader() mydr.Close() End Using
Thanks in advance..
Hi,
I'm fiddling around with VS Extensibility and am trying to interact with the WpfTextView.
I'm struggling slightly getting to grips with the new model. Basically all I want to do is change the selected text (equivalent to TextSelection.CharLeft(true,1); using the older TextSelection object). This should be a case of interacting with some aspect of my IWpfTextView object's Selection property. But I can't work out which.
How do I do this with the new model?
I've 'inherited' a website and although I'm happy with the .NET side of things I know very little about Javascript. I've a simple validation function that isn't working. I need to check that a date entered in a field is not after today. The rest of the site is written in such away as to be culture aware and as such I don't have any hard coded date formats anywhere else. Can I achieve this validation in JS without hard coding a date format? Here's the code:
function checkDate(src, args) { debugger var Received = document.getElementById('<%= txtTimeReceived.ClientID %>').value; var date_Received = new Date(Received); var currentTime = new Date(); if (date_Received > currentTime ) { args.IsValid=false;  
Someone help me with what I'm missing here...
I have a VERY simple file as you can see... just three tables.
The Problem is that if I do this somethign like this....
var patients = from x in db.CT_Patients where x.CT_Visits...... (error here)
It doesn't display child properties for CT_Visits from CT_Patient like it should. I only get the standard LINQ queries like Select, Where, Orderby etc... What am I missing???
I am using this book http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-MVC-2.productCd-0470643188.htmlI discuss with author Project call NerDinner
there is 2 table Dinners and RVSP stored some information
author tries to retrive information from Dinners table with this function whic is written in Model Folder Class DinnerRepository:here is:
public class DinnerRepository { private NerdDinnerEntities entities=new NerdDinnerEntities(); public IQueryable<Dinner> FindUpcomingDinners() { return from dinner in entities.Dinners select dinner; } } public class DinnersController : Controller { DinnerRepository dinnerRepository= new DinnerRepository(); public ActionResult Index() { var dinners = dinnerRepository.FindUpcomingDinners().ToList(); return View("Index", dinners); } }
when I run this solution there is an error: The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[NerDinner.Models.Dinner]', but this dictionary requires a model item of type
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend