Run dynamic query
-
Hi, I need to run a dynamic query baseed on a parameter. Actualy I have a comboBox in my report filled with TableNames of my DataSource, now I want to select all records of the selected table. I've filled the combo but I'm confused how to run a different and runtime query
Best wishes
-
Hi, I need to run a dynamic query baseed on a parameter. Actualy I have a comboBox in my report filled with TableNames of my DataSource, now I want to select all records of the selected table. I've filled the combo but I'm confused how to run a different and runtime query
Best wishes
If I understand your problem, you can build a string like: mySQL = "select * from " + me.Combobox1.selectedValue Then execute the statement.
-
Hi, I need to run a dynamic query baseed on a parameter. Actualy I have a comboBox in my report filled with TableNames of my DataSource, now I want to select all records of the selected table. I've filled the combo but I'm confused how to run a different and runtime query
Best wishes
-
Hi, I need to run a dynamic query baseed on a parameter. Actualy I have a comboBox in my report filled with TableNames of my DataSource, now I want to select all records of the selected table. I've filled the combo but I'm confused how to run a different and runtime query
Best wishes
If you are using ADO.Net, you can create a command object. By assigning different values to its "CommandText" property, you can conduct queries on different tables. Use ExecuteReader() method to get the result. Please give more details on what API you are trying to use to get access to the database. That way people here can better answer your question.