Database.cs method GetSqlStringCommand is not marked virtual

Topics: Building and extending application blocks, Data Access Application Block
Jul 3, 2009 at 9:45 PM


is there a reason why in class Database.cs the method "GetSqlStringCommand" is not marked virtual ?
In a  proyect i'm working we're creating a spring proxy of the Database class, and while exposing the original interface, the method "GetSqlStringCommand" cant be proxied ,but all the other "execute*" methods do work and the only difference is that the other methods are virtual.

So is there a design decison for this? could it be changed in the future?




/// <summary>
/// <para>Creates a <see cref="DbCommand"/> for a SQL query.</para>
/// </summary>
/// <param name="query"><para>The text of the query.</para></param>        
/// <returns><para>The <see cref="DbCommand"/> for the SQL query.</para></returns>        
public virtual DbCommand GetSqlStringCommand(string query)
if (string.IsNullOrEmpty(query)) throw new ArgumentException(Resources.ExceptionNullOrEmptyString, "query");

        return CreateCommandByCommandType(CommandType.Text, query);


Jul 6, 2009 at 8:34 AM


I think we are not in the right position  to answer that, but one thing we can do is to ask the Enterprise Library team regarding your question. We'll get back to you as soon as they responded.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.

Jul 14, 2009 at 5:56 AM

It's probably just an oversight. I'll see if we can change it in the next release.