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

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.

Related

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

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.

Continuous Integration of SQL Server in Visual Studio Online

I was just about to do a continuous integration of SQL Server scripts with VSTS. I have two script files in my visual studio 2015 database project.
createStudentTable.sql => simple create table script
Script.PostDeployment1.sql => :r .\createStudentTable.sql (pointing to the above script)
Now after the successful build in visual studio online I suddenly recognized that a .dacpac file is also created - see this screenshot:
Now my database has around 100 tables + view and stored procedures. Now does this .dacpac file contain the entire schema details? If so then it would be an huge overhead in carrying this .dacpac with every build.
Please advise.
Dacpac file only contains the schema model definition of your database and it does not contain any of table data unless you add all of insert statements in the postdeploymentscript.sql
The overhead of dacpac is that it compares the model in dacpac and your target database when the actual deployment happens.
This is a trade-off. If you don't use dacpac then you will end up doing all the database versions and version migrations by yourself manually or using another tool that can make those database change managements with ALTER statements somewhat easier.
BTW the scale of 100 table can be handled well by dacpac.

Migrating working sets from old to new Domino Designer installation

I am trying to migrate my working sets to a new installation. While searching the web I found this link which says that by copying the file <DATA FOLDER>\workspace\.metadata\.plugins\org.eclipse.ui.workbench\workingsets.xml we can get our original working sets back. I tried it, but it only restores my working sets and they are empty with no database inside them.
What am I missing here? Does any one know how to get all the working sets from old installation and put it into new installation of Domino Designer?
Databases in designer are held as eclipse projects, so you would need to copy project directories inside workspace directory. You can see their directory names in designer just after database title.
Although, I wouldn't recommend that, because different designer versions may have different structure of its content.
I had the same issue. I migrated from the same Notes 8.5.3 release on the old computer to the new computer, so after reading the tips above, I decided to just replace the whole workspace folder under the C:\Lotus\Notes\Data\ folder on my new PC with the workspace folder on my old PC.
It worked! When I opened the Designer client, I had all my working sets complete with database icons. I don't know anything about the workspace folder, so I probably would be cautious applying such an approach if I were migrating to a new release, but since I had not yet started to work on the new PC, I was prepare to reinstall the software if necessary.
FYI, if you don't want to lose your custom commands in the Domino Administrator client when migrating to a new PC or when installing another release of Notes on the same PC, you simply copy the domadmin.nsf database file from the old environment and replace the one in the new environment (if it exists, it won't yet exist if you haven't launched the app after a new install). If you have upgraded to a new Notes release, then open this domadmin.nsf DB in Designer in the new environment and refresh its design from the StdAdminDatabase template (domadmin.ntf).
http://www.lotusguru.com/lotusguru/LGBlog.nsf/d6plinks/20100310-83ESQC
The Notes client being totally closed, backup or restore the following directories :
..data/workspace/.metadata/.plugins/..
com.ibm.designer.domino.ide.resources
org.eclipse.core.resources/.projects
org.eclipse.core.resources/.root
org.eclipse.core.resources/.safetable
org.eclipse.ui.workbench

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.

copy a whole application to new application visual C++ MFC/Smart Device?

I am using Visual studio 2005 for my development. I am doing a smart device application using Visual C++ MFC.
I had an application runnning perfectly on a device with ARMV4, till recently we receive a new Device with ARMV4I. the application is running on the new device but some features are not working, mainly serial port communications.
I compiled the existing application to new ARMV4I but still doesnt work.
I had an idea to create a new application and choose ARMV4I using the wizards, and then then compile it to use in my device..I have some trouble doing that!
My question is how to create a new application and copy/add/insert the old files, images, dialogs, headers and others from the old one and make it works.
if you have idea, please give some detailed information.
thank you
This is not an answer for your question, rather, another procedure to follow to achieve your goal.
Create two dummy projects with exactly the same name; one for ARMV4I and the other for ARMV4.
Compare the resulting .vcproj files (they are XMLs) using a visual diff'ing tool (e.g. WinMerge)
Identify the changes between them that makes one work and the other not
Apply these changes to your existing project. It should work now.
If you still need to copy files into your new project, just copy your .cpp / .h / .rc / res files into their appropriate directories and edit your .vcproj file manually to reflect these new files.

Resources