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.. }
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.
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....
I'm trying to create custom WPF control, similar to DataGrid. DataGrid was great as a base class for a different custom control I needed, because I could do something like this:
public class Person { public string Name {get; set;} public string Phone {get; set;} public string Email {get; set;} }
... and I can reuse it elsewhere with collections of different type, binding its properties to columns of different width and style.
What I need now is something similar, but differs in a way, that DataGrid is no longer good fit for the base class.
What I'm interested in is: how does DataGrid "tell" the columns in Columns collection, to have the type of ItemsSource bound collection as a DataContext? How does the Name property of Person class become available to the column in DataGrid.Columns?
I am trying to get my program to search for the account ID in the structure and deletes the record as the account ID is found. The problem is that my codes are not working. (since my whole program is too long, I only show a part of it.) Here are my codes:
I must create a program (a simple main.cpp in console interface) which deletes two spaces for every newline in a file. If a line has no space, it goes straight to the next line to the end of the file. After the program is to resave the file contents into a new file that has the same name as the old, but change the extension to. Modif
The problem is I can not do that ... Do you have a sample code that does this?
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?
// 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?
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;
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.
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] ....
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]...
I got an assignment at school asking for a program that can implement functions that store, get and deletes text/binary data to a given memory area. We are supposed to make kind of like a tiny-mini OS..any links to some tutorials or explanations hon ow to understand this and be able to make a program like this on my own?
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?
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.
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);
So I have linked list and function which deletes element if next element is bigger, so my code is working but its not working with first element, in the comment I have wrote code which I would code for checking that first element, but when ever I check it is blowing up all program.
#include <iostream> using namespace std; struct llist { int x; llist *next;
I have a class 'A' which is almost perfect for my needs. Class 'B' uses class 'A' I've now designed Class 'C' and Class 'D' and noticed that there is a good chunk of code in class 'B', 'C' and 'D' for using Class 'A' is duplicated. I've separated out this code in specific, standalone functions in each of the classes. Now I'm wondering where this code should go. At the moment, the functions are duplicated in the three calling classes (B, C and D). Placing the functions into class 'A' would break the single responsibility principle. Inheritance to add functionality would likely break both SRP and LSP. The one that seems that it may work is composition.
However, Is designing a complete class just for a few functions over kill?
Would it be valid for classes 'B', 'C' and 'D' to access both the new class 'E' (which would depend on A) and the old class 'A' (which would have to be the same instance as the instance in the new class 'E'), or should the new class 'E' provide sufficient functionality so that Classes B, C and D don't need to access Class A directly? It would seem that its then an incomplete interface of the original object with additional functionality (ie, incompatible) Or should I do it a completely different way?
I am making a game and want to make an updater that grabs the source code from a page on the web. Can this use things that are available to all platforms? It could just be something that grabs the text from the page and executing it (maybe using something like Python's exec() command ?) BTW I'm using mac
this is my code i want to put the part where i have it do multiplication and addition into functions. and then call them so that it can run the addition and multiplication. Heres my code
# include <iostream> using namespace std; int main(){
I'm pretty new to C++ and I'm on Binary Trees in "Jumping into C++"! I've just created a DLL project on Code::Blocks, and I cannot get it to build and run: "You must select a host application to "run" a library..." is the message that I'm getting when I run the main code file. It's had no changes to it (except for a few extra, unnecessary line feeds), and it's the file which Code::Blocks generates on a DLL project.