Exemple #1
0
        //public static SqlConnection Con;

        public ClsSql()
        {
            var           sConStr = ClsComm.SqlConnectionString();
            SqlConnection Con     = new SqlConnection(sConStr);
            var           ConStr  = ClsComm.SqlConnectionString2();
            SqlConnection Conn    = new SqlConnection(ConStr);
        }
Exemple #2
0
        public static DataSet GetDs2(string Qry)
        {
            string connectionString = ClsComm.SqlConnectionString2();
            //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);
        }