I'm using Visual Studio 2010
In my project I was added a local database Data.sdf
Now I wanna use LINQ TO SQL with it, but when I drag and drop the database table into the LINQ designer , I get the following error in Visual Studio :
"The selected object(s) use an unsupported database provider"
Am I miss something ?
How can I fix it ?
LINQ-to-SQL is only officially supported when used with a full version of Microsoft SQL Server (including Express editions). While it's possible to use it with SQL Server CE (which is what it appears you're trying to do) and some others, extra steps are required.
You can either:
Use SqlMetal.exe to generate your .dbml file, then load it into your project (assuming you're using SQLCE 3.5; it doesn't appear to work with 4.0)
Keep an identical copy of your database schema in a SQL Server Express database on your local machine. Use that for design work, then connect to your SQL CE database at runtime.
Geometry, Geography and Hierarchy data types are not supported in LINQ to SQL.The only way it would be to not reference those columns and modify them so they can hold null values
I had this issue but it was resolved after installing the EntitiFramework package from Nuget.
ppm> install-package EntityFramework
Related
I have problem that is all my team members are altering the Sps and functions and
some conflicts occurred through the development
is there anyway or tool to store and get all version of them ?
the problem is before releasing the new version, i don't want a tool to compare difference between two databases like what Red gate SQL_Compare
thanks in advance
You may make use of the features in Visual Studio and TFS(or any other source control mechanisms). All that you need to do is to
Create a SQLServer DB Project in Visual studio and configure it to
your desired database.
Bind the project to a source control (TFS,
SVN etc.,)
Every time you have a change in DB, you can just compare the changes using .scmp file and click update.
You may refer this post for more information:
http://candordeveloper.com/2013/01/08/creating-a-sql-server-database-project-in-visual-studio-2012/
Hey IO have an old access data base and I have reeated the New data base using SQL Server Management Studio but all the data is still in the Access data base and I was wondering how to link these two. I have been trying to create the linked tables in access using the ODBC tool but none of the table I want are appearing?
Was wondering if anyone has any ideas on how I can do this?
Also I then have started to create the front end of the database using Visual Studio but cant get the fields to populate as the SQL database currently has no data linked to it
Instead of linking tables have you considered using SQL Server Express (you did not mention what the 'new database' is, assume Access?) and the data import wizard to port the data to SQL Server? You get all the tools by downloading 'SQL Server with tools' from Microsoft. And use SSMS for management functions, it is much easier than the Visual Studio interface.
I am publishing an ASP.NET MVC 5 solution from my development box to my hosting provider. I have been using entity framework with localdb v11.0 on my dev box. My hosting provider provides a SQL Server 10.0 database.
I am attempting to move my entire localdb to a SQL Server 10.0 db at my hosting provider including creating and populating destination tables from scratch using Microsoft's SQL Server Management Studio Import wizard.
I noticed that the wizard's default column mapping for the destination tables was trying to create what should be nvarchar columns as date columns at the destination in every table. So I manually changed all the incorrect mappings. However when I executed the actual import, the tables created at the destination had columns which should have been defined as nvarchar as date instead, so the import process ignored my corrected mappings and failed as soon as data was uploaded.
I would like to know if this is a known bug in SQL Server Management Studio, and if so, is there an easy workaround. If not I will have to do this a different way which will take a lot longer, which isn't the end of the world, but would be an annoying waste of time.
Used the "Edit SQL" button within column mapping to check that the column mapping had been changed. I noticed that it had for nearly all columns, but not all, so manually changed it for the others for which datatype had erroneously remained as Date.
I am trying to take a legacy database that is now on SQL Server 2008 R2 and create a database project within Visual Studio 2010 for it. There are several stored procedures that used some "on-the-fly" temp tables (the kind where you SELECT * INTO #NewTempTable) Obviously this causes some SQL04151 reference warnings in the database project.
Is there any way to fix or just maybe ignore these specific warnings? I know the immediate answer might be to actually declare the temp table within the procedure and define the columns, but at this point, that isn't an option.
This does not appear to be an issue with the latest database project type for VS 2010, installed as part of SQL Server Data Tools.
Try to install SQL Server Data Tools. After it's installed you'll be able to upgrade your database project to the new type by right-clicking it in Solution Explorer. (The new project type is backwards compatible with SQL 2008 and SQL 2005 and also comes with some significant improvements.)
FYI the new project type has a very generic name of "SQL Server Database Project" and you'll find it in the "SQL Server" template group as opposed to the "Database > SQL Server" group.
Turn SET FMTONLY OFF in your stored procedures.
From MSDN:
Returns only metadata to the client. Can be used to test the format of
the response without actually running the query.
Your issue is that by default Visual Studio has this setting turned on... which allows it to determine the format of the response without running the query, but this doesn't work if temp tables are used.
Here's a discussion of this issue on MS Connect: Improve FMTONLY Intelligence
Per Microsoft's response, this is fixed in 2012, but won't be addressed in earlier versions.
Lastly, here's a related discussion on the FMTONLY issue.
I have Visual Studio 2010 Beta 2 and SQL Server 2008 installed. I'm working with a populated database and want to modify various column types. SQL Server Management Studio requires me to drop tables to do this, and get pretty finicky given my moderate level of knowledge of SQL Server.
However, I heard the new database project type supports changing the database schema to the desired format and it will handle creating and running all the scripts to implement the changes.
I've created a VS2010 database project using the existing database as the source, but so far haven't had much luck figuring out the appropriate method to make the changes without getting an error.
As a result, I'm looking for any reference info I can find on using VS2010's capabilities in this area. Any suggestions?
write scripts instead of using the gui. You can use alter table for instance to change a column. Never use a GUI of any kind to create a change to a database table.
Here's a walk through of the new VS2010 "Deploy-SQL" tab in the properties page of web application projects.