Here is the retrieval of the data:
string connectionString = ConfigurationManager.ConnectionStrings["CString"].ConnectionString;
// string connectionString = WebConfigurationManager.ConnectionStrings["CString"].ConnectionString;
string selectSQL = "SELECT Field1, Field2 FROM Table";
SqlConnection con = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(selectSQL, con);
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
Suppose I want the data output to a generic literal content holder exactly like so:
['Field1', Field2'],
['A', 11],
['B', 2],
['C', 2],
['D', 2],
['E', 7]
where Field1 and Field2 are the column names specified in the query. How do I get it to iterate over each returned result and return in this format?