Adding column manually to table in dbml file - linq-to-sql

I manually added a column to a table in a .dbml file by editing the xml.
Hereafter I rigthclicked the .dbml and chose 'Run Custom Tool'.
I'm new to linq-to-sql and is working on an existing MVC webapp with domainmodel and viewmodel.
The solution also contains a database project which I know was not updated automatically.
Now I need to know how to check that everything was updated correctly. Is it only the .dbml and the .designer.cs that I can expect to be changed after running the custom tool?

'Run Custom Tool' does the trick. Nothing else is needed.
And no other files than .dbml and the .designer.cs files are changed.

Related

How to Programmatically Add .rdl Files in the SSRS Reporting Project?

I have a Visual Studio 2019 project that I made using Report Server Project Wizard. In this project, I import reports (.rdl) files from a different report server project. To add a report, I right click on the project in the solution explorer and do Add > Existing Item and then choose the .rdl file and then it gets included in the project. Is there any way to include the reports (.rdl) files programmatically in the project? For example, can I create a C# console app to copy (.rdl) files from one report server project and then actually add them into a different report server project. Simple copying and pasting .rdl files from one project to another is not working - the file even after it is pasted doesn't show up in the project.
I have tried using EnvDTE to access the solution and project objects, but all the online sources, such as this - https://flylib.com/books/en/3.50.1.50/1/, that provide info on EnvDTE have example code written in VB and it shows you how to create a new solution and project objects and then add a file. What I want is programmatically access the object of the current(existing) report server project and somehow programmatically add .rdl files from another folder into this project. Is that possible?
Thanks
Unless you have hundreds of projects, I can't see the point of building something that is pretty easy to do anyway. You can select multiple files when you do "Add Existing Item".
Having said that, all you need to do is copy the file to the target project folder and then add an entry into the project file in an item group
e.g.
<ItemGroup>
<Report Include="My First Report.rdl" />
<Report Include="My Second Report.rdl" />
<ItemGroup>
You could probably get away with processing this as a simple text file.

How to upgrade Linq to SQL dbml file from old version of VS?

I opened an old project, and I can't open the dbml file.
For some reason I get "Cannot load.. check Error List window for details".
But, there aren't any errors.
I can create new dbml file, so there is no problem in the viewer itself.
Is there a known issue?
The first thing I would check is the connection string of the dbml file, which you can find in the FileName.designer.cs (or could be .vb instead of .cs) file that is attached to the FileName.dbml file.
If you say you can create a new dbml file, then it is possible that the old dbml file has an outdated connection string.

Using dbml file with visual studio

I am developing an asp.net application where some dbml files have been created. When I click on a dbml file called "Test.dbml" and that I unfold it, I get the three following files :
Test.cs
Test.dbml.layout
Test.designer.cs
However when I create a new dbml file and that I unfold it, I only get the two following files :
Me.dbml.layout
Me.designer.cs
I don't understand why I don't get the Me.cs like the existing dbml.
I only have access to the old code, not to the developper who code it so I cannot ask him the question.
Thanks in advance foryour help.
By default VS generates a .dbml.layout (visual layout) and .designer.cs (C# generated code) in addition to the .dbml file (XML definition of the mappings)
If you were to put your code in the .designer.cs file it would get lost so VS can also generate a .cs file for you to put your code in.
Simply right-click on the DBML and choose View Code.
At compile time the .cs and .designer.cs are effectively merged together as they are partial classes (the partial keyword needs to be on the class definitions)

Is it possible to export/import Project.params within SSIS?

Does SSIS 2012 allow to export settings of a project located into Project.params for a further import into another project?
You can simply copy and replace the Project.params file in your new project with the file from the existing project. This obviously overwrites any existing project parameters. If you have need, you can patch the two XML files together just add/remove SSIS:Parameter tags as required.

importing a pre-existing edmx file is a new vs 2010 solution

Hi I started from scrath a new vs 2010 solution.
How can I add a preexisting edmx file generated with the vs tool avoiding mess :)? (The cleanest way)
Thanks a lot!!
I am quite sure that adding the edmx file as an existing Item will work quite well. You will have to add the adequate connectionString in your config file however.
<add name="<EntityContainerName>" connectionString="metadata=res://*/<pathToEDMX>.csdl|res://*/<pathToEDMX>.ssdl|res://*/<pathToEDMX>.msl;provider=System.Data.SqlClient;provider connection string="Data Source=localhost;Initial Catalog=MyDatabase;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
where pathToEDMX is the path to your edmx file in the project (for exemple Models.Model if you included the Model.edmx file in the Models directory of your project)
You will want to change the database connection string in this mmodel connection string too.
In order for this connecion string to work, the model option "Metadata Artifact Processing" must be set to "Embed in Output Assembly"
I agree with the Eilistraee, But I have another openion which is very much procedural. you can add this existing edmx file to your project. then you can open the edmx file and create database from this model(this can be done by right clicking on the entity diagram. ), when you select the proper database, it will automatically create the connection string in your app.config. Good luck.
If you want to do this, the way I found to do this is:
Open the solution that the contains the project you wish to import into.
Add the project that contains the edmx you want to import.
Copy and paste the edmx file from one project to the other.
Remove the second project and proceed.
This might be necessary: Open the edmx, adjust namespace, etc and save it.
VS 2013 and EF 6.1