init lserp cs 5.0
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
|
||||
namespace Zhaizj.Framework.Data {
|
||||
|
||||
/// <summary>
|
||||
/// sqlserver ÌØÊâÓï·¨´¦ÀíÆ÷
|
||||
/// </summary>
|
||||
public class SQLServerDialect : IDatabaseDialect {
|
||||
public String GetConnectionItem( String connectionString, ConnectionItemType connectionItem ) {
|
||||
String str = connectionItem.ToString().ToLower().Replace( "userid", "uid" ).Replace( "password", "pwd" );
|
||||
String[] strArray = connectionString.ToLower().Split( new char[] { ';' } );
|
||||
foreach (String item in strArray) {
|
||||
if (item.Trim().ToLower().StartsWith( str )) {
|
||||
return item.Replace( str, "" ).Replace( "=", "" ).Replace( " ", "" );
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String GetTimeQuote() {
|
||||
return "'";
|
||||
}
|
||||
|
||||
public String GetLimit( String sql, int limit ) {
|
||||
return sql.ToLower().Replace( "select ", "select top " + limit + " " );
|
||||
}
|
||||
|
||||
public String GetLimit( String sql ) {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public String GetParameter( String parameterName ) {
|
||||
return ("@" + parameterName);
|
||||
}
|
||||
|
||||
public String GetParameterAdder( String parameterName ) {
|
||||
return ("@" + parameterName);
|
||||
}
|
||||
|
||||
public String Top {
|
||||
get { return "top"; }
|
||||
}
|
||||
|
||||
public string GetLeftQuote() {
|
||||
return "[";
|
||||
}
|
||||
|
||||
public string GetRightQuote() {
|
||||
return "]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user