I am trying to initialize the designer view with an ODBC connection. Our database has many tables and often linked with foreign keys. The designer assignment throws and ODBCException when trying to retrieve the schema for the database:
var wNewListLabel = new combit.ListLabel22.ListLabel();
var wNewListLabelDesigner = new DesignerControl();
var conn = new OdbcConnection(usercredentials))
ConnectionTimeout = 800
wNewListLabel.DataSource = conn;
wNewListLabelDesigner.ParentComponent = wNewListLabel ;
//Assigned the designer to the WindowsFormsHost
This Line of code throws the ODBC Exception and causes the application to crash
If I run SQL Profile during this command, I can see the SQL that List and Label is trying to execute and fails:
exec sp_executesql N’
If I manually run this SQL I get the same error. The issue is, why is it trying to execute this SQL?
Lab_Package.Laboratory_ID is a numeric column but it is trying to convert a string value that is unrelated to the ID column.
Is there a way to fetch the schema without querying the tables like the Designer is trying to do?
Please let me know if you need more details.