C# コード:
command = new SqlCommand(null, connection);
command = createSQLQuery(command); // returns a valid SQL Query that returns results in SQL Management Studio 2012
//dataGridView1.DataSource = GetData(command);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
connection.Close();
dataGridView1.DataSource = GetData(command);
debugMySQL();
public DataTable GetData(SqlCommand cmd) {
//SqlConnection con = new SqlConnection(connString);
//SqlCommand cmd = new SqlCommand(sqlcmdString, cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
connection.Open();
DataTable dt = new DataTable();
da.Fill(dt);
connection.Close();
return dt;
}
WinForm で C# を使用し、Visual Studio 2012 で開発しています。