Пример #1
0
 public static void TestGetProperty()
 {
     try
     {
         myConnection.Open();
         var helper = new SqlDataHelper();
         var state = helper.GetConnectionProperty(myConnection, "State");
         myConnection.Close();
         foreach (var prop in myConnection.GetType().GetProperties())
             Console.WriteLine(helper.GetConnectionProperty(myConnection, prop.Name));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
     finally
     {
         myConnection.Close();
     }
     Console.ReadLine();
 }
Пример #2
0
 public static void TestGetProperty()
 {
     try
     {
         myConnection.Open();
         var helper = new SqlDataHelper();
         var state  = helper.GetConnectionProperty(myConnection, "State");
         myConnection.Close();
         foreach (var prop in myConnection.GetType().GetProperties())
         {
             Console.WriteLine(helper.GetConnectionProperty(myConnection, prop.Name));
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
     finally
     {
         myConnection.Close();
     }
     Console.ReadLine();
 }
Пример #3
0
        static void Main(string[] args)
        {
            myConnection.Open();
            SqlDataReader myReader = null;
            var           helper   = new SqlDataHelper();

            var        state     = helper.GetConnectionProperty(myConnection, "State");
            var        query     = "SELECT  * " + "FROM    TABLE_BUG";
            SqlCommand myCommand = new SqlCommand(query, myConnection);

            myReader = myCommand.ExecuteReader();
            helper   = new SqlDataHelper(myReader);
            var result = helper.Fetch(20);

            helper.GetReaderProperty("Fetched");
            Console.ReadLine();
        }
Пример #4
0
        static void Main(string[] args)
        {
            myConnection.Open();
            SqlDataReader myReader = null;
            var helper = new SqlDataHelper();

            var state = helper.GetConnectionProperty(myConnection, "State");
            var query = "SELECT  * " + "FROM    TABLE_BUG";
            SqlCommand myCommand = new SqlCommand(query, myConnection);
            myReader = myCommand.ExecuteReader();
            helper = new SqlDataHelper(myReader);
            var result = helper.Fetch(20);
            helper.GetReaderProperty("Fetched");
            Console.ReadLine();
        }