日期:2014-05-20  浏览次数:20854 次

winform 类别异常
  public class DBHelper
    {
        public static readonly string webConstring = System.Configuration.ConfigurationManager.AppSettings["conString2"];

        public  DataSet getAll()
        {
         
                using (OracleConnection con = new OracleConnection(webConstring))
                {
                    DataSet ds = new DataSet();
                    try
                    {
                        string sql = "select function_name from quality_function ";
                        OracleCommand cmd = new OracleCommand();
                        cmd.Connection = con;
                        cmd.CommandText = sql;
                        cmd.CommandType = CommandType.Text; 
                        OracleDataAdapter da = new OracleDataAdapter(cmd);
                        da.Fill(ds);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);