简体   繁体   English

如何查看从MySql数据库到SQL Server Kentico的数据?

[英]How to View Data from MySql Database to SQL Server Kentico?

I have MySQL Database that Contain data i want to view in KenticoCMS 7.0 since there is no support from Kentico to MySQL DataBase , i have change the Connection string inside Web.config file 我有包含要在KenticoCMS 7.0中查看的数据的MySQL数据库,因为从Kentico不支持MySQL数据库,我更改了Web.config文件中的连接字符串

from : SQL Server Connection String to : MySQL Connection String 从:SQL Server连接字符串到:MySQL连接字符串

and the result was kicking out to configuration Page 结果被踢出配置页面

<add name="CMSConnectionString" connectionString="Persist Security Info=False;database=SaDb;server=.\SQLExpress;user id=sa;password=P@ssw0rd;Current Language=English;Connection Timeout=240;" />

to reconfigure Database Again like first time i install Kentico 重新配置数据库,就像我第一次安装Kentico一样

<add name="MySQLConnection" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;Database=test;Uid=root;Pwd=root;" />

is there is any idea about view(just view) mySql data without convert it to SQL Server DB or making Web service to do this process? 是否有关于视图(仅查看)mySql数据的任何想法,而无需将其转换为SQL Server DB或使Web服务执行此过程?

You can't change the main connection string of Kentico database. 您不能更改Kentico数据库的主连接字符串。 It results in new database installation as you described. 如您所描述的,这将导致新的数据库安装。 In your situation you will have to develop a custom code to connect to MySql database. 在您的情况下,您将必须开发自定义代码以连接到MySql数据库。 Creating a custom webpart may be a good way. 创建自定义Webpart可能是一个好方法。 Basically what you need to do: 基本上,您需要做的是:

  1. Create a custom webpart - how to do it . 创建一个自定义的webpart- 怎么做
  2. Install MySql drivers - copying assemblies from MySql connector-net into your website bin should be enough. 安装MySql驱动程序-将程序集从MySql连接器网络复制到您的网站bin中就足够了。 Package can be downloaded here . 包可以在这里下载。
  3. Connect to MySql database - tutorial here . 在此处连接到MySql数据库- 教程
  4. Retrieve and display data in a way you want. 以您想要的方式检索和显示数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM