I wan't to use Sql Server 2008 as production environment with provider System.Data.SqlClient and Sql Server compact 4.0 with provider System.Data.SqlServerCe.4.0 for integration testing with SpecFlow.
Is it possible to use the same edmx file in Entity Framework for the different environments?
In case of Yes as an answer, how can I split the EDMX and keep different mappings?
I already have the production environment working with Sql Server 2008 and have generated a Sql Server compact 4.0 file (.sdf) from the Entity Model but when i try to connect to the compact database it gives me various errors.
I found this line in my EDMX file:
Provider="System.Data.SqlClient"
I think it will be possible to use SQL CE, if you change the values as folows:
Provider="System.Data.SqlServerCe.4.0" ProviderManifestToken="4.0"
Related
Building a razor pages application usign ef core 2.1.1. Development DB server localDB, target SQL server SQL 2008 r2.
I get the following error on the target server:
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'.
Invalid usage of the option NEXT in the FETCH statement.
I suppose the generated SQL code is targeted to SQL server 2012 and up.
How do I force ef core to generate code for SQL server 2008?
Thanks!
EF Core, or more specifically the underlying driver used when interacting with SQL Server Microsoft.EntityFrameworkCore.SqlServer only supports SQL Server 2012 and onwards. Reference
One alternative to make your Skip and Take queries work is to use the below when configuring your DbContext
services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(connection, opt => opt.UseRowNumberForPaging()));
I want to use exist db on mysql from mvc asp.net.
I installed mysql plugin for vs and mysql connector net.
Add connection string to config.
When I start vs in server explorer I see working connection, but when in project I try to add new ado.net entity data model -> generate from database wizard don't know about mysql in general, there are defaultconnection to MS sql and only two varients for new connection:
Microsoft SQL Server
Microsoft SQL Server Database file
Other
Maybe I forgot something install?
Thanks for help.
I have application developed in Visual Studio 2010, .NET 4.0, using MySql database.
I have installed Entity Framework 5.0 and EF 5.x DbContext Generator for VB (using NuGet), then MySql Connector 6.5.5. I'm using Model First approach, so I created two tables, then I chose "Generate database from model.." option. After setting connection provider and connection parameters (with successful test connection to database), I clicked "Finish", and *.sql file was generated but nothing was created in my database. Worse still, the generated SQL script is in SQL Server Flavour and it has a header:
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 03/22/2013 12:11:00
-- Generated from EDMX file: C:\Apps\app\DataAccessLayer\DbModel.edmx
-- --------------------------------------------------
SET QUOTED_IDENTIFIER OFF;
GO
USE [MyDatabase];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO
(...)
How to enforce EF with Mysql and MySql Connector to automatically create database tables, and to generate MySql script, no SQL Server script?
Best regards,
WP
Question comments give us and answer. Summary:
1) Change DDL Generation Template property of the *.edmx model to SSDLToMySQL.tt (VS)
2) Database is not generated automatically. You must execute the generated script yourselves (In Visual Studio in Server Explorer view, or using other tools, i.e PhpMyAdmin).
I have installed the latest .net connector, I can add MySQL databases as Data Sources, I can even browse through the data from Business Intelligence Studio.
The problem is that I cannot create a datasource view, or if I do create one without tables, trying to add them after the fact gives me the same error.
Specifically it looks like the data source view wizard tries to submit queries against the MySQL database using square brackets/braces, and the query bombs.
I get an error message like:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[my_db].[cheatType]' at line 2
How can this be done?
Get the MySQL ( 6.3.5 ) .net connector ( from MY SQL )
Edit the connection string ( in the designer paste in the connection string ) so that it has the new "SQL SERVER MODE=True" option.
Apparently it affects performance - but what can you do
My sample connection string...(passwords & userids omitted )
server=svr215;User Id=;password=;Persist Security Info=True;database=dw;sql server mode=true
For any of you facing this issue more recently, there are two approaches that you may want to consider as well
Use the DevArt dotConnect connector at http://www.devart.com/dotconnect/mysql/. Using the .NET data source, you can connect your SSAS cube directly to MySQL.
Some have worked with doing OpenQuery connections to MySQL by connecting to SQL Server for the DSV and then using a linked server connection to MySQL. Some of those details are noted within http://dennyglee.com/2012/09/26/sql-server-analysis-services-to-hive/.
Try using Caps when adding it to the connection string:"....;Sql Server Mode=True"
Tried using named queries instead of tables?
Create a new named query in the DSV, as SELECT * FROM MySQLTable, then build in the DSV on top of that.
I would recommend using SQL Server. You will save yourself a lot of time and headache trying to do it this way. If your tables don't need transforming, just use SSIS to move the data from MySQL to SQL Server.
This is what we did at my previous employer - OLTP was MySQL and we built the warehouse in SQL Server, then used SSAS off of that warehouse for the cube.
I have tried with Visual Studio 2015 and SQL Server Data Tools 2015 on Windows 7 Machine, experiencing problems with the following versions:
net connector 7.0.4
net connector 7.0.3
net connector 7.0.2
net connector 6.9.8
net connector 6.9.7
net connector 6.9.6
net connector 6.9.5
net connector 6.9.4
net connector 6.9.3
net connector 6.9.2
net connector 6.9.1
net connector 6.9.0
net connector 6.3.5
from here: https://downloads.mysql.com/archives/c-net/
As a result:
The SSIS is working but SQL builder always failing.
The SSAS is not woriking as it cannot retrieve the database schema.
Finally, after hours i got it working with the following installation of new product of MYSQL Community from here: http://dev.mysql.com/downloads/file/?id=466291
Now, the only problem i expirienced was that the connector was unable to translate some queries due schema mapping, so setting sqlservermode=true to the connection string will fix that problem too!
Is there any way to connect SQL Server 2008 Reporting Services to a Sybase SQL Anywhere database (ASA or ASE)? Maybe using ODBC...
If so, have you done it? Kindly share experiences and any notable considerations.
Our environment is x64 SQL RS but needs to connect x86 SQL Anywhere 9.0. 64bit SQL doesn't recognize 32bit ODBC SQL Anywhere. We resolved the issue by installing a x86 SQL Server 2008 R2 express, setup a System ODBC for SQL anywhere and linked server to SQL Anywhere on SQL instance.
Check "Allow inprocess" in the the linked servers->Provider->ASAProv.90. Restart SQL Service
Linked server -> Server Options: Set RPC and RPC Out both to True.
I have had success setting up the Data Source Type (DPE) as OLEDB and using the ASA 9.0 OLEDB provider. The connection string editor in VS2008 does not allow me to create a connection string that works, so I just type in the entire connection string as follows:
Provider=ASAProv;Eng=[ASAInstanceName];Dbn=[ASADatabase];Uid=[ASAUser];Pwd=[ASAPwd];Links=tcpip(host=[servername])
Replace the the portions with square brackets with the values that are appropriate for your installation. The square brackets should NOT be in your final connection string and quotes are not need either. The links statement at the end is probabaly not necessary if the database is on your local machine. Even though I included the database username and password, it didn't seem to be used. I also had to set them in the DataSource Credentials. When deployed to SSRS, I also set them in the DataSource to be saved on the server.
I've noticed that performance is VERY slow when previewing the report in local mode in VS 2008. Instead, I have started deploying my report everytime I want to "preview" it so I can look at it on the SSRS server through a browser. Performance is much better that way.
I am looking for a BETTER solution than what I've described as I've quickly found that multiple-value parameters are not supported with this type of connection to ASA. If you find a better solution, perhaps using the ASA ADO.NET Provider, please post. From what I've found though, there is no DPE that exists for ASA.