Example #1
0
        //public static SqlConnection Con;

        public ClsSql()
        {
            var           sConStr = ClsComm.SqlConnectionString();
            SqlConnection Con     = new SqlConnection(sConStr);
            var           ConStr  = ClsComm.sqlConectionStr_IntDB();
            SqlConnection Conn    = new SqlConnection(ConStr);
        }
Example #2
0
        public static DataSet GetDs2(string Qry)
        {
            string connectionString = ClsComm.sqlConectionStr_IntDB();
            //string connectionString = ConfigurationManager.ConnectionStrings["SQLCon"].ToString;
            SqlConnection connection = new SqlConnection(connectionString);

            if (connection.State != ConnectionState.Open)
            {
                connection.Open();
            }
            SqlCommand     selectCommand = new SqlCommand(Qry, connection);
            SqlDataAdapter adapter       = new SqlDataAdapter(selectCommand);
            DataSet        dataSet       = new DataSet();

            adapter.Fill(dataSet, "SMData");
            connection.Dispose();
            return(dataSet);
        }