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); }
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); }
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); }