Пример #1
0
        public static void ReadStoredProcExample()
        {
            string name = "GetUserByName";

            var data = GenericDAL.ReadStoredProc(name, "@FirstName", "Yan", "@LastName", "Zhang", "@Theme", "1");

            string json = JsonConvert.SerializeObject(data);

            Console.WriteLine(json);
        }
Пример #2
0
        public static void ReadTableExample()
        {
            string qry = "Select * FROM [Op_Intel].[pnr].[WebUsers] where [FirstName] =@FirstName and [LastName] = @LastName ";

            var data = GenericDAL.ReadTable(qry, "@FirstName", "Yan", "@LastName", "Zhang");

            string json = JsonConvert.SerializeObject(data);

            Console.WriteLine(json);
        }
Пример #3
0
        public static void ReadStoredProcWebRequestExample()
        {
            string name = "GetUserByName";

            // simulating QueryString in web request  var parameters = Request.QueryString;
            NameValueCollection myCol = new NameValueCollection();

            myCol.Add("FirstName", "Yan");
            myCol.Add("LastName", "Zhang");
            myCol.Add("Theme", "1");

            var args = ConstructArgs(myCol);

            var data = GenericDAL.ReadStoredProcFromList(name, args);

            string json = JsonConvert.SerializeObject(data);

            Console.WriteLine(json);
        }