I'm working on small shopping cart project, and I'm using asp.net mvc 4 with SQL Server 2008, and development environment is Visual Studio 2013.
I have created database and I will give example:
I have one table called TransactionLines where I store purchased products, now I have relation to table Products, so relation in SQL Server Management Studio is OK
TransactionLines:ProductID -> Products:ProductID
but when I create .dbml file in VS relation is from TransactionLines:TransactionLineID -> Products:ProductID.
Does anyone know what is the problem with it?
Screen shot from SQL Server Management Studio
Screen shot from VS Server Explorer
Thanks in advance.
It must be bug with Visual Studio 2013, as I had this problem as well and a system reboot fixed it.
It came back a few weeks later and as far as I can tell it happens when I change certain tables in the DBML I need to immediately reboot the system after save and it works. I am still trying to figure out a better solution to UPDATING my DBML without requiring a system reboot.
Related
I'm trying out making websites with C# and I have a problem with my SQLite DB.
I've seen that you can Display every element of a DB with a gridview and it is automatic. But I cannot make it work with SQLite.
So I searched to find a solution to my problem and I found an article going through the process but it's a bit outdated.
He installed the System.Data.Sqlite(x86 x64) and I was trying to find that one but I couldn't find it.
But I found System.Data.Sqlite.x64 and I assume that it's the same and that it just doesn't support x86 anymore.
Nuget
Afterwards he opened the Entity Data Model and he had 2 options instead of 4 as me and also not the same ones.
I clicked on the EF Designer from database cause it had somewhat the same description as the one he clicked on.
Entity Data Model Wizard
After I click next I go to the Choose Data Source but I don't have an option for SQLite.
Choose Data Source
If I'm doing something wrong or I didn't understand something please correct me.
Thank you for your time!
Seems like this was raised with Visual studio community: sqlite-data-connection-not-appearing-in-server-exp
Solution proposed is the following:
Hi Robin,
It appears the developer that created the SQLite/SQL Server Compact Toolbox also has a solution to support VS 2017. See https://github.com/ErikEJ/SqlCeToolbox/wiki/EF6-workflow-with-SQLite-DDEX-provider
Or you can get the extention from the marketplace here
Works with
Visual Studio 2012, 2013, 2015, 2017, 2019
I have a visual studio project and I want to use it on another computer. I found that there is a way to upload the project but I wanted to know if its possible to share also my database so it will be linked to the project anytime I change the computer Im working with, and the database will update itself on both computers.
?
create a database project along with your c# project and put all your tables, stored procs, etc. in it. check in the database project in your version control. when moving to a new computer "publish" the database project the first time, or do a "sql compare" any consecutive time to apply the db changes.
https://msdn.microsoft.com/en-us/library/hh272677(v=vs.103).aspx
https://msdn.microsoft.com/en-us/library/hh272690(v=vs.103).aspx
New to the forum, hoping for some help. I have just started getting into Visual Studio and have installed VS Community 2015. I have searched for this answer and though it is listed a few times, the things that I saw in those threads I tried but no luck and it says not to ask questions, only provide a suggested answer so that's why I have started this new one. I am using this tutorial: https://msdn.microsoft.com/en-us/library/ms233763.aspx to create a sql database.
On the third line of instruction, it says: In the list of item templates, scroll down and choose Service-based Database. However, under Visual C# items, Service-based Database is not listed. I followed instructions in another thread to delete and re-setup the templates but it still does not show. I also confirmed that I have SQL Server Data Tools installed as SQL Server Object Explorer is listed when I go to the VIEW menu.
In the templates area when creating a new project, there is a SQL Server section below the Visual C# area which is for creating a new database project. It does not show it as Service-based Database so is it just a newer version of it and I should try my luck with that? I'm at a loss otherwise.
Thanks,
Todd
I have successfully created a sample server-based database in Visual Studio 2015 Community Edition with settings in Tools>Options>Data Tools>Data Connection under SQL Server Instance Name set to 'SQLEXPRESS'. However, upon performing a new query against the database, it displays this error:
Msq 208, Level 16, State 1, Line 1 Invalid object name 'Recipe'.
My query is this:
SELECT * FROM Recipe
My database is named as "Cookbook" with tables Recipe, Ingredient, RecipeIngredient.
When initiating a query, in the Available Databases drop-down menu, the database I have created isn't listed. Is that possible? For Visual Studio to have created a database but not include it in the Available Databases menu?
But creating a database in SQL Server Management Studio is ok. It's in the Available Databases list.
My assumption is that Visual Studio has created a local database instead of a service-based one.
Anyway I am following this guy's tutorial
youtube.com/watch?v=L1m1Znj9dZA (2:28 )
and encountered this error. Please enlighten me. :)
Try building/rebuilding your project, helps most of the times.
I just want to make a very simple database in microsoft visual studio.
What I did?
1. I created new project in C# as WindowsFormApplication (created default code, I didn't change it, because I am interested in making the database only, so no source code).
2. Then on the Solution Explorer Panel of Visual Studio, I right clicked on the application and clicked on Add -> New Item.
3. Then I selected Service Database.
4. The database is created.
5. I go to server explorer and expand the database and tabled, then i see there is no table.
6. I right click on tables and then I click add new table and I get this error
"Object reference is not set to instance of an object"
There are plenty of answers for this error on stack overflow and other sites but nothing helped me.
I reinstalled Management Objects and Compact 4.0 ... still nothing.
My OS is windows 7. 64 bit operating system.
Visual Studio Ultimate 2012
I really need to make a test database.
I enabled the disabled services from task manager and then reinstalled everything and worked fine.