コード例 #1
0
    private static void Main(string[] args)
    {
        OdbcConnection connection = new OdbcConnection("");
        OdbcCommand    command    = new OdbcCommand("SELECT * FROM Table WHERE Id = @id AND Column = @text", connection);

        command.Parameters.Add("@id", OdbcType.Int).Value       = 2;
        command.Parameters.Add("@text", OdbcType.VarChar).Value = "test";
        string preparedSql = command.GetPreparedSql();

        // preparedSql = SELECT * FROM Table WHERE Id = 2 AND Column = 'test'
        Console.ReadLine();
    }