setup project for visual studio application using advanced installer with local db data is retrieved but not saved in db - visual-studio-2012

I am using advanced installer (simple) to create the setup project of a GUI i am making in visual studio. upon installation, it is possible to read data from the databse i.e the records that are already added can be read but as i try to save data in databse that function is not working and the application stops working. i think that the connection string is right that is why iam able to read data from it but why cant i update data. plz help.
the databse is is service-based local database

This might happen if you have the database stored in the same install location as your application binaries. Usually that is a folder under Program Files.
You're application cannot write under this location when running as a standard user, and it should never write/store data in that location.
If you're not using the Application Data folder to store your database, I suggest you update your app to do so, this should solve your problem.

Related

MongoDB recovery database from Compass

I was working on a new project. There was a lot of data that I needed to add locally. I used mongoose and nodejs for this. But windows 11 where the project is installed does not open now. Fortunately, I have ubuntu on my computer and I can access windows files.
My question is that; There is a data folder in the mongoDB directory in the program files. Is there any chance I can recover my old data from here?

Moving neo4j database from Windows to Ubuntu

I created neo4j database using cypher queries through browser and some python (py2neo) routines.
Now, I have to transfer this database to another neo4j instance on my Linux desktop.
What I did-
Zip the contents of folder default.graphdb.
Unzipped the contents of the zip file to data/graph.db in my linux installation.
Also the user:pass of the database are same.
But when I goto the browser, I can't find any of that data. The directory does point to the folder that I extracted to (/home/goelakash/neo4j-community-2.3.0/data/graph.db).
How do I get that database?
EDIT - messages.log
https://drive.google.com/file/d/0B3JPglmAz1b5ak1vRWR5Z0p5UVE/view?usp=sharing
The data files should be located directly in data/graph.db. So check e.g. if there is a file called neostore.nodestore.db. If so, check the permissions - the system user running Neo4j needs to have full recursive read/write permission on the graph.db folder.
Also make sure that you're using the same version of Neo4j on Windows and Linux (or upgrade the store following the reference manual).
For more insight attach the startup sequence form data/graph.db/messages.log.

How can I bundle my database file into my app, ready for a side load install?

I am creating a Windows 10 Universal App which uses a local SQLite Database.
In order for the app to use the database file It must be placed in:
C:\Users\<Username>\AppData\Local\Packages\<Name of Package>\Local State
Now I understand this is the 'local' file structure for the application. However I have a pre-made database that the app needs to interact with and therefore should be bundled as part of the app on install.
Is there a method of including my database in a usable fashion when distributing my application via a side-load install?
Furthermore, This problem is of paramount importance as This 'C:\' Directory will not exist when pushing my application to the mobile phone or other Windows 10 (not a desktop) device.
You cannot package the database directly as read-write data (local state). If you only ever need to read from the database, you can just include it in your project and read it from Package.Current.InstalledLocation.
If you need to write to the database, but it contains some initial values you want to ship with your app, then you still need to include the database in your project, but then copy it from the InstalledLocation to ApplicationData.Current.LocalFolder if it doesn't exist when your app starts up.
You can all ways export your existing data base as SQL script and save it in your project assets.
On the first run of your application you can create the Sqlite file in your LocalFolder, and run the script with CREATE and INSERT queries.

Visual Studio 2012 Pro C# - how to update xsd for newly created columns in db table

Please bear with me as I give a little history, then I will get to the problem:
I am rewriting a web app in Visual Studio 2012 Professional using C# and SQL Server 2012 Express. I am creating new pages / logic but am reusing the data access objects from the old app, which was written in VS2008 and SQL Server 2008 Express by another developer years ago. I got a backup of the db from the SQL Server 2008 db server and restored into the SQL Server 2012 db server.
Most everything works fine in the new application, but I have recently added a few columns to the Contacts table in SQL Server and now I am stuck at how to update the .xsd and related files for Contacts. When I said that I reused the data access objects from the old app, what I meant was that I simply copied all of the .xsd, .xsc, .xss, .xsx and designer.cs files for Contacts and other objects from the old project (VS2008) to the new (VS2012).
I think all of these .xs* files are auto-generated when you use a data source configuration wizard or something in Visual Studio? The problem is that I just copied the files into the new project to get the code behind working so that I could get and update data. But now I must update these files some how so they may be aware of the newly added columns, and I think I have to, in this new project, add a new Data Source? I don't want to perform surgery by updating the files manually, that could get messy I would think...
I can probably figure out how to add the data source, but my concern is will that process complete successfully considering the existence of the files already? Should I remove all of the .xs* files I copied in and add the datasource so it will recreate all those files again, and with the new columns? What should I do? I have backed up my new project in case something goes terribly wrong, so I can torpedo this project as many times as I need to until I get it right!
Thx in advance and thanks for reading this far.

How to update a database programmatically, so that the updated one is included when publishing?

I'm copying and updating data from another database to mine (programmatically), this works fine when debugging. It also remembers it between debugging sessions. However, when I publish the program, the original database is empty.
How do I make sure the updated one is included?
This is an SQLCE database by the way.
When you are debugging the compiler will copy your SqlCe database to the bin\debug folder and that's the one you will be using when your program is running.
So when you copy data while debugging it will not end up in the database that is a part of your project but in the one in the debug folder!
Using the following tool could help. This will allow you to script the data that's in your database to a sql script so you can run it in your publish environment.

Resources