Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Custom Webpart Doesn't Databind using different local database View modes: 
User avatar
Member
Member
brycec-norsoft - 5/24/2010 10:40:51 AM
   
Custom Webpart Doesn't Databind using different local database
I am developing a custom webpart in Kentico CMS and I am having troubles getting my webpart with a datasource and datalist to DataBind to a local Database on the same local network as the Kentico CMS website. All other parts of my webpart work (Textboxes/Buttons).

I cannot open the website locally as it is on another network, so I am cloning the webpart through the kentico CMS Site Manager and then opening the Webpart over the network to manipulate its contents. I have successfully tested the Stored Procedure in Visual Studio and my DataSource pulls data.

Is Kentico Blocking the other Database without me knowing it?

Do I need to add this Database somewhere in the Site Manager so Kentico can see it?

Any help would be greatly appreciated.

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 5/25/2010 6:45:35 AM
   
RE:Custom Webpart Doesn't Databind using different local database
Hi,

You just need to add custom connection string into your web.config file and in code behind of your custom web part you should be able to access your custom non-Kentico CMS database with for example standard ADO.NET support. Your Kentico CMS web site (Your web server where your Kentico CMS is running) needs to see your SQL server. There is no setting in Kentico CMS to allow connection to different databases and Kentico CMS is not blocking the connection to different databases in any way. So, you just need to ensure that your web server is able to see/connect to your SQL server and then check your custom code.

You can also try to check Kentico CMS event log (CMS Site Manager -> Administration -> Event log) or OS event log for more detail information why you are not able to connect to your SQL server.

Best regards,
Miroslav Remias.

User avatar
Member
Member
sonic4ss-gmail - 9/29/2013 3:27:11 AM
   
RE:Custom Webpart Doesn't Databind using different local database
Hi,
am I free to make this custom connection MySQL Connection and add (MySQL.data.dll) to bin file ,so i can use diffrent connection to database using kentico CMS 5.0 or any other version ?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/30/2013 3:31:29 PM
   
RE:Custom Webpart Doesn't Databind using different local database
Kentico is a standard ASP.NET website. So if you have the references to those other dll's there should be no problem in making the connection to those databases.

User avatar
Member
Member
kentico_sandroj - 9/30/2013 5:30:39 PM
   
RE:Custom Webpart Doesn't Databind using different local database
Hello,

Yes this is possible as with any other ASP.NET application, more information is available here. Please let me know if you have any questions.

Best Regards,
Sandro