Advertisement
Anaristos

sqlServer (InternalInterface)

Dec 11th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.77 KB | None | 0 0
  1. /************************************************************************
  2. --[ License ] -----------------------------------------------------------
  3.  
  4.   This program is free software; you can redistribute it and/or
  5.   modify it under the terms of the GNU General Public License
  6.   as published by the Free Software Foundation; either version 3
  7.   of the License, or (at your option) any later version.
  8.  
  9.   This program is distributed in the hope that it will be useful,
  10.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.   GNU General Public License for more details.
  13.  
  14.   You should have received a copy of the GNU General Public License
  15.   along with this program; if not, write to the Free Software
  16.   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  17.    
  18.   You may also access the licence here: http://www.gnu.org/licenses/gpl.html
  19.  
  20.  ------------------------------------------------------------------------
  21.   Copyright © 2009-11 Gomez & Associates
  22. /************************************************************************/
  23.  
  24. using System;
  25. using System.Collections;
  26. using System.Collections.Generic;
  27. using System.Data;
  28. using System.Data.SqlClient;
  29.  
  30. namespace sqlServer
  31. {
  32.     public partial class DataProvider
  33.     {
  34.         internal enum reqType : int
  35.         {
  36.             None   =  0, // dummy request
  37.             Insert =  1, // Insert statement
  38.             Delete =  2, // Delete statement
  39.             Proc   =  3, // Procedure
  40.             Select =  4, // Select statement
  41.             Update =  5, // Update statement
  42.             ProcNR =  6, // Procedure with no return.
  43.             Scalar =  7, // Execute scalar.
  44.             NQuery =  8, // General non-query.
  45.             Open   =  9, // Open request.
  46.             Close  = 10, // Close request.
  47.             BadReq = 11  // Watermark
  48.         }
  49.  
  50.         private delegate object execMethod(string sql, Hashtable args);
  51.  
  52.         Hashtable methods = new Hashtable();
  53.  
  54.         private void initDelegateTable()
  55.         {
  56.             methods.Add(reqType.Insert, new execMethod(execInsert));
  57.             methods.Add(reqType.Delete, new execMethod(execDelete));
  58.             methods.Add(reqType.Proc,   new execMethod(execProc));
  59.             methods.Add(reqType.Select, new execMethod(execSelect));
  60.             methods.Add(reqType.Update, new execMethod(execUpdate));
  61.             methods.Add(reqType.ProcNR, new execMethod(execProcNR));
  62.             methods.Add(reqType.Scalar, new execMethod(execScalar));
  63.             methods.Add(reqType.NQuery, new execMethod(execNonQuery));
  64.             methods.Add(reqType.Open,   new execMethod(execOpen));
  65.             methods.Add(reqType.Close,  new execMethod(execClose));
  66.         }
  67.     }
  68. }
  69.  
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement