Visual studio 2010 database explorer sql query clears table - visual-studio-2010

I've created a database in visual studio 2010 in the following way: Data->Add new datasource->Database->Entity Data Model.
Now, in my wpf app I can load and save data successfully, when closing the
app and opening again the data will still be there, but as soon as I try
retrieve the table data in Visual Studio's Database explorer it returns
an empty table, and running the application after that also returns no data.
It is as if using database explore to query data clears it.
Any help would be greatly appreciated.

Tim Anderson seem to explain what is going on, here:
http://www.itwriting.com/blog/689-where-is-your-sql-server-ce-database.html

Related

Visual Studio hangs when clicking "Close & Update" in Tabular model

I am going crazy now with a tabular project in Visual Studio.
When I try to update a table through the Source Data property:
and then clicking on Design and then refresh the query and afterwards clicking on Home -> Close and Update the window turns grey and it hangs forever. I have to end the VS process from Task Manager in order to continue working.
There is no extra steps applied or some other logic going on in the M query (autogenerated) but still freezes and will not update the data/columns.
I have also tried doing that from the Partitions window as proposed
here on MSDN
but it still freezes.
Visual Studio Enterprise 2015 version, Update 3
Please save me :)
#Pepys My apologies for not posting this as a comment but cant at the moment :(.
I have a few things that you can try:
Adjust your query is SSMS to only send in a sample size of your total records. If you have 10 years then only populate 1 just to test this out.
Connect to your data in Visual Studio via the SQL Server Object Explorer to verify you can connect to it.
The solution could be to use the Partitions window instead of the Source Data
It won't freeze that often when clicking "Close & Update"
Edit:
Visual Studion 2017 works much better and since I started using it, I haven't got this bug so thumbs up for fixing it :)

Visual Studio 2017 does not handle properly SQLite DB

I used JetBrains Rider to create an SQLite database (14 tables and 6 views). Rider was more user friendly than Visual Studio 2017. I went back to Visual Studio for the c# programing part. The "SQLite-SQL Server Compact Toolbox" was able to connect to the DB but there were some error messages. For example when I wanted to "Edit top 200 rows" of a table there was an error but the select * worked. More importantly, when I wanted to add ADO object (to use Entity framework) there was an error again.
When I created some tables in VS there was no such problem. So I wonder where can be the problem?
I figured out that the problem is with "SQLite-SQL Server Compact Toolbox". If the definition of the Views has comments then you can not add entity framework based on your database using Visual Studio. Though the database is ok, the select * from myTable works.
Rider has no problem with comments in View.
The toolbox has no problem with comment in table just in the view.

Is there a model browser window for LINQ to SQL?

I'm looking for a way to list the tables/objects in a LINQ to SQL model, and search them, similar to the Model Browser window for Entity Framework.
Are you using MS SQL Server? If so you should be able to use the Database Diagrams.
It turns out that in Visual Studio 2017 the model browser can be activated by pressing Ctrl+1 if the edmx diagram is displayed at the same time.
For a work-around, I'm editing the *.dbml file directly. However, this seems much more error prone (copy-paste errors, requires more knowledge of framework, etc.), for repetitive changes.
UPDATE (and actual fix):
I had to install SQL Server Data Tools (SSDT) for my specific version of Visual Studio. This doesn't have to match your target version of SQL Server.
See here for Visual Studio 2017:
https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017
Note that using the standalone installer did NOT work for this purpose (LINQ to SQL model browser). Only using the Visual Studio installer, and after a restart did the browser load.
I didn't update this answer immediately, so there may be something I'm missing; please add more detail if you encounter this issue.

visual studio 2013 cannot retrieve database objects

Firstly, Visual Studio 2013 connects to database and retreive tables normaly.
I added more table to database and edit relationship. After that I update data source in Project Explorer tree but it's failed. Even I tested the connection It's ok. But VS 2013 cannot retreive data objects - Message Box shows "Retreiving database object..." in very long time without reason. Can you show me how to fix it?
I found the way to fix this error. Just only find and kill all of process are using database

Connection with SQL database in visual studio 2010

I have connected with the database successfully by using wizard in server explorer. but the data source is showing nothing. i have googled and search on msdn help. but not get help.
I want to add data source. but add new data source option is disabled for me.
I am using windows form application...
I want ask that am i doing right. could you please tell me how can i get rid of not showing thing.
PLEASE HELP!!!
The Server Explorer of Visual Studio 2010 and the Datasource of your application are completely different. Check the following links to see how you can connect your Windows Form Application with Sql-Server database:
Walkthrough: Connecting to Data in a SQL Server Express Database (Windows Forms)
Connecting to a Database with Visual Studio Tools

Resources