using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient; 


namespace WareHouse
{
    class mydb
    {
        public SqlCommand cmd;
        public SqlConnection con;
        public SqlDataAdapter da;
        public DataTable dt;

        public mydb() 
        {
            con = new SqlConnection();
            con.ConnectionString = Properties.Settings.Default.DBWare_mdbConnectionString.ToString();
            cmd = new SqlCommand();
            cmd.Connection = con;
            da = new SqlDataAdapter(cmd);
            dt = new DataTable();
        }
        public DataTable selectfun(string sql) 
        {
            cmd.CommandText = sql;
            con.Open();
            da.Fill(dt);
            con.Close();
            return dt;
        }
        public void exeFun(string sql) 
        {
            cmd.CommandText = sql;
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
        }
    }
}
