I have created a report in visual studio with two static datasources on it for testing purposes while in development to ensure that the report shows the data correctly. I have two one for the main report and then there is a table on the report which has another datasource. If i preview the report everything works as i would expect. I then have the following code to create the form and assign the datasources dynamically at runtime so that i can select the correct data from the mysql database based on users input.
However when i now run the application and run the code i am getting the error that's attached.
I have double checked the SQL strings and the connection string including copying and pasting them exactly into the static data sources and its still not working. I'm sure that i am doing something wrong but i can't see what at all. Please can someone assist me with this.
Also the strDBConnectionString variable is also used in several other locations including to populate a listcontrol which allows the user to select the item they wish to generate the report for and that is all working as expected.
I have also double checked the SQL and connection strings at runtime to ensure that they are populating correctly.
Thanks in advanced