Page 1 of 1

How to add database using code?

Posted: Wed Apr 01, 2020 6:03 am
by Lobjey
I add a database in the .cs file,it can be shown on the page,but if I click "New query" button,there ia an error in the js.Can someone help me?

var oracleDb = new StiOracleDatabase("TestOracle", "TestOracle", "Data Source=*****;user id=*****;password=****;");
report.Dictionary.Databases.Add(oracleDb);

Uncaught TypeError: Cannot read property 'typeConnection' of undefined
at BfDesigner.aspx?msgid=1234&stiweb_component=Designer&stiweb_version=2017.1.10&stiweb_action=Resource&stiweb_data=AllNotLoadedScripts:11461
at StiMobileDesigner.ExecuteScript (BfDesigner.aspx?msgid=1234&stiweb_component=Designer&stiweb_version=2017.1.10&stiweb_action=Resource&stiweb_data=DesignerScripts:10071)
at StiMobileDesigner.InitializeEditDataSourceForm (BfDesigner.aspx?msgid=1234&stiweb_component=Designer&stiweb_version=2017.1.10&stiweb_action=Resource&stiweb_data=DesignerScripts:10133)
at HTMLDivElement.newQuery.action (BfDesigner.aspx?msgid=1234&stiweb_component=Designer&stiweb_version=2017.1.10&stiweb_action=Resource&stiweb_data=AllNotLoadedScripts:11460)
at HTMLDivElement.button.onclick (BfDesigner.aspx?msgid=1234&stiweb_component=Designer&stiweb_version=2017.1.10&stiweb_action=Resource&stiweb_data=DesignerScripts:19081)

Re: How to add database using code?

Posted: Fri Apr 03, 2020 8:31 am
by Lech Kulikowski
Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.