Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************************************
- --[ License ] -----------------------------------------------------------
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 3
- of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- You may also access the licence here: http://www.gnu.org/licenses/gpl.html
- ------------------------------------------------------------------------
- Copyright © 2009-11 Gomez & Associates
- /************************************************************************/
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- namespace sqlServer
- {
- public partial class DataProvider
- {
- internal enum reqType : int
- {
- None = 0, // dummy request
- Insert = 1, // Insert statement
- Delete = 2, // Delete statement
- Proc = 3, // Procedure
- Select = 4, // Select statement
- Update = 5, // Update statement
- ProcNR = 6, // Procedure with no return.
- Scalar = 7, // Execute scalar.
- NQuery = 8, // General non-query.
- Open = 9, // Open request.
- Close = 10, // Close request.
- BadReq = 11 // Watermark
- }
- private delegate object execMethod(string sql, Hashtable args);
- Hashtable methods = new Hashtable();
- private void initDelegateTable()
- {
- methods.Add(reqType.Insert, new execMethod(execInsert));
- methods.Add(reqType.Delete, new execMethod(execDelete));
- methods.Add(reqType.Proc, new execMethod(execProc));
- methods.Add(reqType.Select, new execMethod(execSelect));
- methods.Add(reqType.Update, new execMethod(execUpdate));
- methods.Add(reqType.ProcNR, new execMethod(execProcNR));
- methods.Add(reqType.Scalar, new execMethod(execScalar));
- methods.Add(reqType.NQuery, new execMethod(execNonQuery));
- methods.Add(reqType.Open, new execMethod(execOpen));
- methods.Add(reqType.Close, new execMethod(execClose));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement