Getting formated SQL

  • Thread starter Thread starter Emerson Yukio Honda
  • Start date Start date
E

Emerson Yukio Honda

With the code below :

SqlParameterDictionary sqlParamDic = new SqlParameterDictionary();

StringBuilder sqlBuilder = new StringBuilder();

string sql;

sqlBuilder.Append( "insert products (product) ");

sqlBuilder.AppendFormat( "values (@name) ", product.Name);

sql = sqlBuilder.ToString();

sqlParamDic.Add( new SqlParameter( "@name", product.Name ) );

SqlHelper.ExecuteNonQuery( GlobalFunctions.GetConnectionString(),
CommandType.Text, sql, sqlParamDic );

How can I get the SQL witch framework used to insert into the database? When
I check at commandtext, its still with the placeholders.

Emerson
 
Back
Top