C Sharp :: Declaring Navigation Property In Entity Framework
Nov 3, 2012
I developed a sample application in EF which has 3 tables
PersonDetails, BankDetails and FixedDepositDetails.
Please find the table structure below
create table PersonDetails
(PersonId int Primary Key,
PersonName varchar(30))
create table BankDetails
(BankId int Primary Key,
BankName varchar(100),
[Code] ....
But when I run the application I get an error as
The navigation property 'Bank_Id' is not a declared property on type 'FixedDepositDetails'. Verify that it has not been explicitly excluded from the model and that it is a valid navigation property.
If I am not wrong I think I have made some mistakes when creating the model.
View 1 Replies
ADVERTISEMENT
Apr 15, 2015
I'm a bit unsure on where to put cascading deletes in my models and how far they extend.
I've got four tables
TrafficLog
has a One to One with
TransactionHistory
Has a zero to Many with
OutgoingService
and
Exceptions
Now i'd like to put cascading deletes on, so that if i delete a record from TrafficLog it deletes from the other three.
So do i set up my model with cascade delete just on the primary like this
modelBuilder.Entity<TCC_ArchivedApplicationTrafficLog>()
.HasRequired(TCC_ArchivedTransactionHistory)
.WithRequiredDependent()
.WillCascadeOnDelete(true);
or do i need to enable it on the other three tables too?
View 3 Replies
View Related
Apr 28, 2015
I need to show in a comboBox thats shows infor from Entity framework but i need to select a specific colum in the tables..
All in C# visual studio xaml form
So I created a var but i get and output: name of programe.NLHEntities
using (var context = new NLHEntities()) {
var blog = context.EtagesChambres
.Where(b => b.TypeChanbre == "Prive")
.FirstOrDefault();
textBox2Type.Text = Convert.ToString(blog);// i put a text box to see what the output would be..
}
View 14 Replies
View Related
Aug 27, 2014
Yes, exactly, and I have been successfully creating EF Model before from the same database.... Why is it acting up now... I did check SO and they seems not to have a solution for it also....
View 8 Replies
View Related
Apr 17, 2013
i have created application using gembox i create a word file and save data on it but i want after saving it itis opened to me using microsoft word directly
it is the code
DocumentModel document1 = new DocumentModel();
Section section1 = new Section(document1);
document1.Sections.Add(section1);
[Code]....
View 1 Replies
View Related
Apr 23, 2012
I want to change the string name to property name..
for example
public class Code {
public int RD{get;set;}
public Code() {
GetCode();
}
private void GetCode() {
string cd= "RD";
cd=1; // cd represent to property name "RD"
}
}
View 2 Replies
View Related
Jun 1, 2012
I have base class with some properties(variables).I want to inherit that class and want to change name of that properties in the derived class using concept of Shadowing.
View 1 Replies
View Related
Jun 14, 2012
I am working with repeater.. Actually i have placed a linkbtn in item template.. In that linkbtn i am displaying names from database.... And i have created an event for the lnkbtn.. In that event i want to get the text property of linkbtn....
View 1 Replies
View Related
Oct 29, 2014
I want to navigate a 2D Matrix (for example: int iMatrix[10][10]), with a pointer.
I'm not sure how to traverse this matrix in both demensions with a single pointer.
I want to know because I'm going to pass a pointer of this matrix into a function and do work with it.
View 4 Replies
View Related
Mar 2, 2014
So I have assigned this method to each TextBox. It works fine pressing the left arrow and right arrow, but for some reason will not work using the up and down arrows. I have tested the string, using MessageBox and it is correct...the loop even proves it finds a matching TextBox. It is correct as in it displays the TextBox name it should be selecting but doesn't. I have no clue! Now the first select method is the one I want to use, I used the loop to check to see if it was even finding a match. It does find it but doesn't select it. The naming convention for my text boxes is r1c1 where the first number indicates the row and the second number is the column. There are 9 rows and 9 columns. This SHOULD be working but for whatever reason it is not. I've even put a message box inside the if statement for the up and down keypress check and it pops up when i press up or down.
private void Navigate(object sender, KeyEventArgs e) {
TextBox input = (TextBox)sender;
string nextBox = input.Name.ToString();
if (e.KeyCode == Keys.Left) {
if (int.Parse(nextBox.Substring(1, 1)) > 1 && int.Parse(nextBox.Substring(3, 1)) == 1)
[Code] ....
View 7 Replies
View Related
Dec 9, 2014
I've got a datagrid setup and i'm using an entity model as the datasource, i thought i had stuctured my query so that i would only get a single column result but the display within the datagrid shows two columns?
here's the xaml for the form
<Window x:Class="UpdateAccelaAssets.winUsersRemove"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Remove User" Height="300" Width="300">
[Code] .....
And I've attached a screenshot of the result.
Attached image(s)
View 3 Replies
View Related
Nov 15, 2014
Ok so I have a function call that moves an Entity from one vector to another, and if one doesn't exist then it creates one and moves it:
std::vector<std::unique_ptr<Entity>> ActiveEntities;
std::vector<std::unique_ptr<Entity>> EntityPool;
// Creates a generic entity in the entity pool
void EntityManager::CreateEntity() {
[Code] .....
In this case it checks the entity pool for an entity, if one exists it moves it to the active entities and then returns the unique id, if one doesn't exist it creates one then calls itself to run the check again to verify and move the new entity.
My question is, is this a valid form of recursion since it only incurs a single loop of recursion, or should I reform the entire system to work differently? If so, how do you set this up in a way that does not cause recursion?
View 3 Replies
View Related
Mar 8, 2014
I'm new to C programming and I need to write a "small" expandable menu framework and I don't know where to start off.
This is my task: Create an expandable menu framework in C where you can add a infinite number of entries and Sub menus containing other Menu points or where the entries refer to a external function. So far I've created the structures I need
Code:
//Menu structure
struct menu {
char mtitel[MAX];
struct mpoint point;
struct menu *next, *prev;
[Code] .....
View 2 Replies
View Related
Dec 20, 2014
I'm working on a game with an entity-component system. I have a Manager class that is handling all of the components by feeding them into vectors set up for each type of component. Right now I have a lot of repeated code for each kind of component.
void add_pos_comp(shared_ptr<Position> pos_comp);
shared_ptr<Position> get_pos_comp(int id);
const vector<shared_ptr<Position>>& get_pos_comps();
void add_vel_comp(shared_ptr<Velocity> vel_comp);
shared_ptr<Velocity> get_vel_comp(int id);
const vector<shared_ptr<Velocity>>& get_vel_comps();
I've tried generalizing this with templates, but I've been confused by how I should organize the collection of vectors for each component. I had it setup so that they were all in an unordered_map, but how to get the templated functions to find the right map slot to use based simply on the template's parameters.
The full project is here for reference: [URL] ....
View 2 Replies
View Related
Jan 10, 2015
To the topic: I've been following "SDL game development" book by Shaun Mitchell and (besides the many others in the past) I've encountered a problem in one of the chapters.
I'm in "creating and displaying tile maps". The chapter uses tintxml to load data outside the code, which is used to create a "map screen".
The problem is that the program work perfect except for not loading and/or rendering this "screen".
I know this is too vague of an explanation, but I wouldn't know what else to say.
I'm leaving the link to the repository with all the code: [URL]...
View 12 Replies
View Related
Mar 23, 2014
So I'm trying to accomplish something that right seems to hard for it to be worth it. I'm trying to write a plugin framework/system for my game. I have read about it and everything that pops up says it's OS-specific and you have to load the plugins from either a .so file on linux or from a .dll file on Windows. So here lie my questions:
-Is there any universal way of accomplishing this?
-Every way I've seen assumes i know the names of the functions I'm calling which doesn't hold true if the plugin are written by a 3rd party. How would i turn the table on this matter?
View 1 Replies
View Related
Feb 23, 2014
I am trying to load a .bmp file located in the same folder as main.cpp etc. but I'm not sure what to input as the resource path so that it picks it up and, when I distribute it, I want it to be preferably cross platform and run smoothly.
I have tried using:
hello_world.bmp
SDL_Game/hello_world.bmp (SDL_Game is the name of the project)
but it will work if I use the full path. I don't want to do this though, because then it will not work on other computers and platforms.
This is the function I use to load media:
bool loadMedia() {
// Loading success flag
bool success = true;
// Load splash image
gHelloWorld = SDL_LoadBMP("hello_world.bmp");
[Code] ....
I am using XCode 5, SDL2.0.1, OSX 10.9 Mavericks and C++.
View 2 Replies
View Related
May 16, 2013
I've just recently moved from Visual Basic 6 over to C++ and decided that I would try and write a class to mimic the Get/Set behavior seen in a variety of other programming languages. So instead of just using an overloaded function, i.e:
Code:
class NoProp {
LPCWSTR m_Title;
public:
void Title(LPCWSTR NewValue) {m_Title = NewValue;};
LPCWSTR Title() {return m_Title;};
[code].....
So far this code only works with the LPCWSTR type (const wchar_t*). Unfortunately I got to this stage using only that type, and now when I try another type, such as int, it fails. When using the int type I believe it creates an error because the constructor of InitProp expects a type of pointer to be parsed. When I try using it with int* type (the private variable then becoming int **m_Variable) it compiles, thought I cannot access the property like a normal int.
My best guess from here is that I probably have to overload the InitProp constructor in a way that it can setup the Property classes for base-types and pointer-types, and then also modify the Property class to handle both.
View 6 Replies
View Related
May 27, 2013
Working on a console application and I am trying to figure out a way that allows users to enter an object property along with a value. For example
class Box{
public:
int height;
int width;
int length;
[Code] .....
For example if a user inputs "height" for Name and "13" as value I would like to find a way to change ab's height to 13. I want to make this work so that one can add another class and get the same functionality.
I tried looking online and I think maps are a way to do this and I tried doing that but I don't know how to proceed after/what code to write that would allow me to change it.
Note: I can't use if else statements or hardcoding to match the input to member as I want to make this extensible.
View 1 Replies
View Related
May 27, 2013
Working on a console application and I am trying to figure out a way that allows users to enter an object property along with a value. For example
HTML Code:
class Box {
public:
int height;
int width;
int length;
[Code] ....
For example if a user inputs "height" for Name and "13" as value I would like to find a way to change ab's height to 13. I want to make this work so that one can add another class and get the same functionality.
I tried looking online and I think maps are a way to do this and I tried doing that but I don't know how to proceed after/what code to write that would allow me to change it.
Note: I can't use if else statements or hardcoding to match the input to member as I want to make this extensible.
View 7 Replies
View Related
Jan 28, 2015
It's a shock to me seeing the partial display of variables being picked by intellisense. I am working in VS2013 environment. I have a project, in the project Settings file I created string variables of about 100 to be accessed across the files for the project, like this:
A example of thew variable it worked for
public static String TradeportAccordionSystemAdminInstitutionManagement = Settings.Default.[b]TradeportAccordionSystemAdminInstitutionManagement[/b];
An example of the variable it did not work for
public static String TradeportAccordionSystemAdminInstitution = Settings.Default.
So, does it mean that the Settings file has a limit of variables that should be declared in it?
View 2 Replies
View Related
Jul 31, 2013
Here the max sdk plugin is looking at X:projects rather than x:program files (x86)autodeskmaxsdk Inside the autodesk folder, there is a projectsettingspropertysheets subfolder where the plugin is looking for.
Now an error pops up saying it needs X:projectsprojectsettingspropertysheets....How can I fix that?
<Import Project="........ProjectSettingsPropertySheets3dsmax.general.project.settings.props" />
I find it hardcoded / How do I set where visual studio to search the correct property setting files automatically?
View 3 Replies
View Related
Jul 17, 2014
I have been playing around with property sheets/property pages and have been successful in getting them to work in a secondary dialog by calling the property sheet using DoModal().
How to get the property sheet to display on the main dialog of a dialog application.
I am using VS2008 and CMFCPropertySheet and CMFCPropertyPage.
View 5 Replies
View Related
Apr 4, 2013
Is it possible to create property which I can pass parameters? Here is what I would like to do:
__property double a = {read=getA("a"), write=setA("a")};
__property double b= {read=getB("c"), write=setB("c")};
double getA(char *a);
void setA(double value, char *a);
double getB(char *a);
void setB(double value, char*a);
View 3 Replies
View Related
Apr 17, 2013
I have a problem creating a MAPI property. I have code like this:
Code:
intSetProperty( LPPROFSECT lpProfileSection, LPSPropValue lpPropValue) {
HRESULT hr;
LPPROPDATA lpPropData;
SPropValue spvEID;
[Code] .....
I want to create the choose_directory_Automatically property if its not exists. But I don't know how. If the CreateIProp method returns me a pointer in lpPropData how can I put the PropTag and the Value in it?
I have already implemented change the property if it exists already but the Outlook Addressbook stays on automatically until I or the user creates this property. I took a look with OutlookSpy at this property but I could not come any further.
View 1 Replies
View Related
Jan 15, 2013
Later i used trial version of vc2010 and created a static library using the below link. Its worked. [URL] .....
But now I'm using VC2003.Details as follows,
Microsoft Development enviroinment 2003 Version 7.1.3088
CopyRight @ 1987-2002 Microsoft Corporation. All Rights Reserved.
Microsoft .Net Framework 1.1 Version 1.1.4322
CopyRight @ 1998-2002 Microsoft Corporation. All Rights Reserved.
I used the same procedure & created the Static lib. But couldn't use this lib file in my main project.B'cos the project's property window doesn't have the :
Common Properties -> Framework & References
Couldn't find. Here with i attached missed property in VC2003. How can i set this property? Is any other way to use static lib in main project (application)?
View 4 Replies
View Related