Is it possible to have separate DB for each areas in .net-core along with project's DB? - database

I need to create separate database for area in a project. I don't want to join two database together. is it possible or not ?
Actually I wanted to have totally separated projects in one solution but this way I have some issue with routes (only one of them is accessible by routes) so i decided to try area but still I need to have more than one DBs in a project

Yes, of course.
I do not know how you connect to your database, but in your appsettings.json file, put two connection strings with different names for different DB's.

Related

Two projects using the same Django database. Who should create the tables?

I have two Django projects that need to use the same postgres database.
I created the database in one of the projects -- no problems;
I just created the second project. It will need access to tables in the database. It will also need some additional tables that only it will access.
Two questions:
In the second project, I am getting the 'unapplied migrations' message from the main app. How do I safely get rid of this? I don't want the second project changing the parts of the database that were created by the first app. However, I don't want necessary Django setup to not be done (is there any)?
Suppose I want to create a table used only by the second project. Should I do it in the second project and migrate it? Or should I do it in the first project to prevent the second project 'messing' with the database?
Many thanks.

Multiple shared datasets in different report projects

I have a database called CommonDB. I have created shared data sets from this database in one of my report projects. I now have a need to include the same shared data sets in another report project. Ideally it would be nice if I could just point it to the testing site in BIDS and develop my report based on a reference.
I was wondering if there is a way to do this without adding existing data set (as I was hoping to keep the code base the same so I wouldn't have to update it in different projects).I am aware you can also add existing data sets from url but that defeats the purpose as it just downloads a copy to my report solution and it's not synced.
Any ideas? Thanks :)
This scenario is not supported by BIDS/Visual Studio.
It gets worse: If you deploy multiple projects to the same server, using the same Shared Datasets folder, then at runtime they will try to reuse each-others Shared Dataset definitions. The latest deployed Shared Dataset definition will win.
Data Sources have similar issues - although they tend to be less volatile.
To avoid this, I prefer to keep all reports for a single SSRS server instance in a single BIDS/Visual Studio Project. I use Project Configurations to manage deployment of reports to disparate folders.

What's the best way of deploying a schema object to two different databases in Visual Studio?

We have two databases, A and B. A contains tables that should also be deployed to B; however, A should always be considered as the master of those tables. We don't want to duplicate the schema object scripts. We do not want to simply reference A's table from B - they need to be separate, duplicated tables.
As far as I can see, there are two ways to achieve this:
Partial projects: export the shared schema objects to a partial project (.files) file, and import it into the B's database project
Adding shared schema object files to the B's database project as links.
These both have the disadvantage that you need to explicitly specify files - you cannot specify a folder, meaning that any time a schema object that needs sharing is added to A's database project, then either the partial project export would need to be run again, or the new file added as a link to B's project.
What are the advantages and disadvantages of these techniques? Are there any better ways of achieving this that I may have missed? Thanks.
Partial Projects are not supported in the VS2012 RC release, which makes me think that I shouldn't use them. Furthermore, it appears that Composite Projects within SQL Server Data Tools (SSDT) may be the long term solution.
I've discovered that it is possible to link to entire folders by editing the dbproj file manually. For example:
<Build Include="..\SourceDatabase\Schema Objects\Tables\*.sql">
<SubType>Code</SubType>
<Link>Schema Objects\Tables\%(FileName).sql</Link>
</Build>
This works quite nicely, so it will be our preferred solution until we evaluate SSDT. The main drawback that I've found with it so far is that it will include all files in the source database's folders, including those that are not included in the source database project.

Using Alternative DataSources in Sharepoint

As I know, Sharepoint save all users list in one table. I have several sharepoint lists. And I want to store Data from Sharepoint lists in custom MS Sql Server DB. That difrent Sharepoint lists store data in diffrent tables. I want that this data is stored only in my custom DB (not in sharepoint DB).
And I also want that mutual (many-to-many) links between difrent lists in this DB are. For example I have 2 lists Projects and Emploeyrs one project can have many employers and one employer can work on several projects. I want that if I delete emploer from project link for that project is deleted from this emploer.
Could You recomend me some sollutions for this task?
I think I know what your trying to do :\
You might want to look at this http://www.simego.com/Products/Data-Synchronisation-Studio and use dynamic columns
Sounds like a real mashup, I'd bee using some external components like the ASPxGridView from DevExpress, http://www.devexpress.com/Products/NET/Controls/ASP/Grid/, to get the list views since you wont be able to use the internal lists.
To interface towards the internal SharePoint lists I'd use the Camelot .NET Connector from Bendsoft, http://www.bendsoft.com/net-sharepoint-connector/.
With that combination it wont really matter where you put the result, it can be used internally in SharePoint as well as externally and it dont matter if you use 2007 or newer either.

MVC 3 CodeFirst Share sql express database with all of my models

I am creating a data driven website with mvc3 using EF and code first. I am trying to have all of my models share one database so that seperate roles can have access to common tables. I am not sure weather to just use one db context because that seems like it might be the wrong way. I do not want my models to create their own seperate databases. I want them to share but I cant seem to achieve this. Thank to any help.
Instantiating multiple DbContexts will not cause you to have multiple databases unless you pass different connection strings into each one. If you have a single connection string, which will typically be kept in your web.config file, you can have many DbContexts, but they will all share the same database.
You must deploy your database directly to SQL Server instead of using local file in AppData => your connection string mustn't use AttachDBFile.
I was setting seperate DB contexts in all of my Models. I know, what a noob mistake. Thanks for the quick responses anyhow. THIS helped me figure it out and its really and amazaing resource for this stuff

Resources