using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; using Stone.DataService.Biz.BizPublic; namespace Stone.DataService.Biz.Bill { public class F_BarCode { public static DataSet Exec_DataSet(string sql) { try { using (SqlConnection conn = new SqlConnection(WebConfig.BarCodeDB)) { conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = sql; DataSet dsData = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(dsData); return dsData; } } catch (Exception ex) { throw new Exception("条码系统错误,原因为:" + ex.Message); } } public static void Exec_NonQuery(string sql) { try { using (SqlConnection conn = new SqlConnection(WebConfig.BarCodeDB)) { conn.Open(); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = sql; cmd.ExecuteNonQuery(); } } catch (Exception ex) { throw new Exception("条码系统错误,原因为:" + ex.Message); } } } }