Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1012 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
9 changed files with 97 additions and 23 deletions
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Forstmeier Helmut |
||||
* Date: 20.01.2006 |
||||
* Time: 13:44 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace SharpReportCore |
||||
{ |
||||
/// <summary>
|
||||
/// This Class checks for invalid SqlStatements
|
||||
/// </summary>
|
||||
internal class SqlQueryCkecker{ |
||||
internal string UPDATE = "UPDATE"; |
||||
internal string DELETE = "DELETE"; |
||||
internal string noValidMessage = "is no valid Member of SqlString"; |
||||
private string queryString; |
||||
|
||||
|
||||
public SqlQueryCkecker(){ |
||||
} |
||||
|
||||
public void Check (string queryString) { |
||||
this.queryString = queryString.ToUpper(CultureInfo.CurrentCulture); |
||||
|
||||
if (this.queryString.IndexOf (this.UPDATE) > -1) { |
||||
string str = String.Format("{0} is no valid Member of SqlString",this.UPDATE); |
||||
this.Invalid (this.UPDATE); |
||||
} |
||||
|
||||
if (this.queryString.IndexOf(this.DELETE) > -1) { |
||||
this.Invalid (this.DELETE); |
||||
string str = String.Format("{0} is no valid Member of SqlString",this.DELETE); |
||||
|
||||
} |
||||
} |
||||
|
||||
private void Invalid (string invalidArgument) { |
||||
string str = String.Format("{0} {1}",invalidArgument,this.noValidMessage); |
||||
throw new SharpReportCore.SharpReportException(str); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue