Adapter GetSQLstring Method MVC+ (Model-Facade-View-Controller) Framework for ASP.NET
Gets database string value (must be overridden by derived class.)

Namespace: NovaDimension.Data
Assembly: NovaDimension.Data (in NovaDimension.Data.dll) Version: 4.0.204.0 (4.0.0204.0)
Syntax

public abstract string GetSQLstring(
	string pValue
)

Return Value

Type: String
Database string value

Implements

IAdaptable GetSQLstring(String)
Exceptions

Examples

This sample shows how to override the GetSQLstring(String) abstract method.
See Also: AdapterException, LogHelper T 
using system;
using System.Text;
using System.Data.SqlClient;
using NovaDimension.Component;
using NovaDimension.Data;

public class SQLServerAdapter : Adapter
{
    public override String GetSQLstring(String pValue)
    {
        try
        {
            LogHelper<SQLServerAdapter>.DebugBegin(System.Reflection.MethodBase.GetCurrentMethod().Name);

            pValue = pValue.Replace("'", "''");
            StringBuilder value = new StringBuilder("'");
            value.Append(pValue).Append("'");
            return value.ToString();
        }
        catch (Exception ex)
        {
            throw new ExceptionEx<AdapterException>(EnumHelper.Value(AdapterException.ERROR_GETSQLSTRING), ex, true);
        }
        finally
        {
            LogHelper<SQLServerAdapter>.DebugEnd(System.Reflection.MethodBase.GetCurrentMethod().Name);
        }
    }
}
See Also