Kamlesh Singh

Kamlesh Singh

  • NA
  • 3
  • 1.4k

Returning a list of views from MySql Database C#

Jun 25 2019 7:22 AM
I'm building a simple WPF app for my colleagues to use in order to query one of our databases.
 
In the UI I'm trying to allow them to select a pertinent view from which to query. Using the answer in this question fro stackoverflow: Get the column names of a table and store them in a string or var c# asp.net I'm going to also list the columns that they will have access to within the view.
 
To do this, I've been looking for a way to construct a dynamically generated query based on the groundwork of the above link. I'll be changing their query to something like this:
 
string NameOfView = "View1"; string dynamicQuery = "SELECT * FROM " + NameOfView; MySqlCommand(dynamicQuery, connection);
 
In essence, I want to know what possible permutations View1 could be for the particular MySql connection.
 
Thanks & Regards

Answers (2)