I have two DB within my Yii2 Application. I'm trying to use Gii to generate models for SQL-Server 2008. But I keep getting:
Connection does not support reading schema information for 'sqlsrv' DBMS.
I am able to connect to the DB and pull data and use it within my application though, is Gii not available for use with SQL-Server 2008?
I looked into my connection and had mapped my Schema, perhaps incorrectly.
When I removed this from the config it worked:
'schemaMap' => [
'mssql'=> [
'class'=>'yii\db\mssql\Schema',
'defaultSchema' => 'dbo'
]
],
Related
I have an MVC 5 application that I first configured to use Mysql but now would like it to use SQL Server.
My app uses code first and migrations in order to generate the database.
After I changed all the required configuration I tried to run a Update-Database from the Package management console but I keep getting this error:
System.Data.Entity.Core.MetadataException: Schema specified is not
valid. Errors: (0,0) : error 0152: No Entity Framework provider found
for the ADO.NET provider with invariant name 'MySql.Data.MySqlClient'.
Make sure the provider is registered in the 'entityFramework' section
of the application config file. See
http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
This error appears after the database is created. It also appears when I run the application since it checks at that moment if there is any migration to do.
Somehow it still tries to use MySQL even though all providers point to SQL Server.
Any help would be more than welcome.
Thanks in advance
You need to follow the below mentioned steps to overcome above issue.
Step 1 : Use NuGet package to remove and install the relevant packages.This is very important.
If it's not working after the above step then you have to follow the below mentioned steps.
Step 1 : Get a backup of your project and SQL db and keep it in a safe place.
Step 2 : After that you have to delete all your data migration scripts on your app.
Step 3 : Delete the SQL db also.
Step 4 : Recreate all your Migration scripts again and after that run those against the SQL server.
Note : You need to do above steps b'cos it seems EF keep the provider details on the db migration scripts.
I am trying to configure WSO2 CEP to store the events to database table.
I have created Event Stream/Receiver,
I would like publish the Stream on a External Database using Datasource.
i am getting the below error while I trying to create Datasource to mysql or oracle
for mysql datasource
ERROR: Error in creating external data source: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource cannot be found by org.wso2.carbon.ndatasource.rdbms_4.4.1
for oracle datasource
ERROR: Error in creating external data source: oracle.jdbc.driver.OracleDriver cannot be found by org.wso2.carbon.ndatasource.rdbms_4.4.1
Can anyone help me fix this one.
Thanks
I suspect that this issue is due to the missing database drivers in {$HOME}/repsitory/components/lib folder. Can you please check if the relevant database drivers are placed in this directory? You can find the documentation regarding setting up MySql and Oracle databases with CEP, respectively at [1] and [2]. Hope this helps.
[1] https://docs.wso2.com/display/CEP400/Setting+up+MySQL
[2] https://docs.wso2.com/display/CEP400/Setting+up+Oracle
Cheers,
Pubudu.
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 am using quartz in a web application and using QuartzInitializerServlet.
Now to run it on multiple systems, I have added a database to make it run it in clustered mode. The dataSource properties are provided in quartz.properties file but this exposes the database credentials in cleartext.
Is there some way to use QuartzInitializerServlet but provide the dataSource credentials through code (where I can retrieve the credentials stored elsewhere) ?
Here is the documentation : http://www.quartz-scheduler.org/documentation/quartz-2.3.0/configuration/ConfigDataSources.html#configure-datasources
Use the jndiUrl property to specify the jndi name of your datasource:
org.quartz.dataSource.NAME.jndiURL = java:comp/env/jdbc/www_datasource
HIH
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/