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 dbconnClass1
     {
        public DataTable dt;
        public string connStr = Properties.Settings.Default.DBWare_mdbConnectionString.ToString();//@"Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDbFilename=|DataDirectory|\DBWare.mdb_Data.MDF;Initial Catalog=DBWare.mdb;User Instance=True";
        public void dbCon1(string SQL)
        {
            SqlConnection con = new SqlConnection();
            con.ConnectionString = connStr;
            dt = new DataTable();
            SqlCommand cmd = new SqlCommand();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            cmd.Connection = con;
            cmd.CommandText = SQL;
            con.Open();
            da.Fill(dt);
            con.Close();

        }

        public void dbIns1(string SQL)
        {
            SqlConnection con = new SqlConnection();
            con.ConnectionString = connStr;
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = SQL;
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();

        }
    }
}
