I want to use MYSQL database for accesssing the data in a mvc application.
The connection string that i am using in web.config is:
Then I have prepared a model,controller,view for accessing and displaying the data.
I am using LINQ o get the data from database but getting the exception:" A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I have also installed the MYSQL connector.
Please provide me the solution to access the data using MYSQL and LINQ in MVC application
Thanks in advance.
Deleting my previous answer...I read your question as LINQPad, no idea why.
To be short, get a third party provider, I can't speak for others, but devart's dotConnect for Oracle has worked very well for us: Here's their MySQL version.
You could use NHibernate and Linq-to-Nhibernate and then you are not database tied.
NHibernate Files
http://sourceforge.net/projects/nhibernate/files/
But this I guess is dependent on how much time you have to develop!
You can't use LINQ to SQL. You should use entity framework.
Linq to SQL is only for MS Sql.
Use EF to work with any other DB, and then you can use LINQ to EF.
Linq to SQL is obsolete
http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx
LinQ to Sql is used to Connect the MsSql to LinQ.We need third party softwares to Connect LinQ with MySql.
I Can Connect LinQ and Mysql with the help of DbLinq
Refer this Sites
http://www.primaryobjects.com/CMS/Article100
https://olgatherer.wordpress.com/2010/08/19/dbmetal-isnt-hard/
Related
The exception says that there is a network related problem, or that the SQL server does not allow remote access, none of those are true.
Can it be that I'm trying to connect a MySQL server, and not MS SQL?
Thanks
It is because the System.Data.SqlClient namespace is designed for Microsoft SQL Server, to connect to MySQL you will need to download and reference the MySQL .NET Connector http://dev.mysql.com/downloads/connector/net/. You will then use the System.Data.MySqlClient namespace. Hope this helps.
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.
The exception says that there is a network related problem, or that the SQL server does not allow remote access, none of those are true.
Can it be that I'm trying to connect a MySQL server, and not MS SQL?
Thanks
It is because the System.Data.SqlClient namespace is designed for Microsoft SQL Server, to connect to MySQL you will need to download and reference the MySQL .NET Connector http://dev.mysql.com/downloads/connector/net/. You will then use the System.Data.MySqlClient namespace. Hope this helps.
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.