I'm not sure to understand:
1-I must copy the database
2-I put the database in folder like my projet
but how to points to the correct place.(I must add it in ressouces? but it doesn't work).
(if you know tuto(link),I'm very interested for my case,I didn't found for the moment.)
Here my procedure to create my project with Access Database:
2)I chose a DataGridView1
3)in DataGridView1 tasks then "choose data source"
4)add project data source then database
5)new connection then Microsft Access database file (ok)
6)database file Name
7)Pop up"The connection you...." (Yes)
8)Save the connection string to the application configuration file
(I can see my database)
9)New page "Choose your database objects"
Now I can see all information in DataGridView1(with my database in my computer)
When I publish my project to USB key by example, it doesn't work.
I think my procedure is not correct. thank you for your help.
(perhaps you can try my procedure to understand my problem)
Ehr, no, I don't use the wizards as they hide some of the complexity. The connection-string is probably generated and put in the app.config file. That's the thing that "points" to the file and tells the computer which thing to use to read it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
I'm being frustrated by VS2017 when publishing a Winforms project. I want to be able to produce a 'live' version, a 'test' version and a 'training' version of the same application and just switch the database and installation locations for each.
Do I need to purchase an Installer or can this be achieved in VS2017 easily? I have already tried the app.config switching add-in and have managed to get it to work, if not intermittently, but want to be able to select a config from the Configuration Manager that will provide one the 3 versions rather than just a Debug and Release
For varying the physical location you'll need to pass that location as a parameter in the connection-string. Means you could probably get away with simply using a different connection-string in your configuration.
I a a beginner programmer in my senior year of my CIS degree. I have just recently been introduced to the MVC model of web development and I am currently working on a project for a non profit to produce a web application to track their people that check in and check out.
My question is that I ma trying to display their available rooms on my create resident page. I have the code for the total rooms done and it will display. (Currently it goes from a range of 101 to 310)
However, now I need to separate them into wings. North Wing, South Wing, etc. Is there a way to nest lists? Example, pass the view a list of wings and then display the drop down box of available rooms according to what wing they select?
Now this brings me to my next question... Now I have a page takes information about a resident and a room number is selected to put him in. But I am struggling with how to combine these data elements.
This is my post method:
public ActionResult Create([Bind(Include = "LastName,FirstMidName,Birthdate,ServiceBranch,HasPTSD,Note,InVetCourt")] Resident resident, [Bind (Include = "RoomNum")] Room room)
//query rooms table to get the room ID//
var rooms = db.Rooms
.Where(s => s.RoomNum == room.RoomNum)
.Select(s => s.RoomID);
//ResidentContext resident = new ResidentContext();
As you can see, I have tried to use the ResidentContext, but I cannot get that to work.... I have tried to query the Room db and get the room.roomID field out and apply it to the Resident.resident.Add(room) but that also will not work.
I have tried to initialize the new resident with the parameters bound and then initialize the Room with the parameters bound, but I cannot get that to work either.
I'm pretty sure I am missing something pretty simple, but for the life of me I cannot figure it out.
The current table layout is
Resident table that has a foreign key to the RoomID field and a room table.
Can you point me in the right direction? I cannot seem to get anything valuable to read on how to add the roomID to the resident table. (the room already exists)