日期:2014-05-17 浏览次数:20429 次
public static DataSet Query(string SQLString)
{
using (MySqlConnection connection = new MySqlConnection(connectionString))
{
DataSet ds = new DataSet();
try
{
connection.Open();
//MySqlDataAdapter command = new MySqlDataAdapter(SQLString, connection);
MySqlDataAdapter command = new MySqlDataAdapter("set names utf8", connection);
command.SelectCommand.CommandText=SQLString;
command.Fill(ds, "ds");
}
catch (MySqlException ex)
{
throw new Exception(ex.Message);
}
return ds;
}
}