Dapper escape sp_tables procedure error

c# dapper

Question

Am trying to use dapper to execute the sp_tables stored procedure and escape the procedure name as follows but still getting error. var procName = @"sp_tables @table_type = ""'type', 'TABLE'"""; var tables = con.Query(procName, commandType: CommandType.StoredProcedure);

Accepted Answer

For future reference this how I solved it. var tables = con.Query("sp_tables", new { table_type = @"""'type', 'TABLE'""" }, commandType: CommandType.StoredProcedure);



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why