Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8248801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:19:12+00:00 2026-06-07T23:19:12+00:00

As per the Service Stack Ormlite documentation . I should generate the sql query

  • 0

As per the Service Stack Ormlite documentation. I should generate the sql query in debug mode. But, I am not able to see those queries. Simple code

 private static readonly string DataDirLoc =
        Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
        "\\TargetIntegration\\Test\\Debug\\";



    private readonly string dbFileName = DataDirLoc +
                                              "Test.db3";

    [Test]
    public void Can_Generate_log() {
        //var writer = new TextWriterTraceListener(System.Console.Out);
        //Debug.Listeners.Add(writer);
        Debug.Write("this is a try");
        var dbFact = new OrmLiteConnectionFactory("Data Source={0};Version=3;".FormatParams(dbFileName), true,
                                                  SqliteOrmLiteDialectProvider.Instance);
          IDbConnection dbConnection = dbFact.OpenDbConnection();
       var dbCommand = dbConnection.CreateCommand();
        dbCommand.CreateTable<Contact>();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:19:14+00:00Added an answer on June 7, 2026 at 11:19 pm

    You would need the debug build of OrmLite to see the SQL output.
    There are a couple of other ways you can view the last sql:

    Console.WriteLine(dbCmd.GetLastSql());
    

    You can also profile the db connection by setting a connection filter, which you can do with:

    var dbFact = new OrmLiteConnectionFactory(
       "Data Source={0};Version=3;".Fmt(dbFileName), true, 
       SqliteOrmLiteDialectProvider.Instance) {
       ConnectionFilter = x => new ProfiledDbConnection(x, Profiler.Current)
    };
    

    Which if you ran this in ServiceStack will let you see the profiled timing outputs of all the SQL statements. An example of what this looks like is available here:

    https://gist.github.com/1787443

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android Service that accesses the database about once per minute. Is
Using AmazonSimpleEmailServiceClient.sendEmail() ; as per java docs All service calls made using this client
Per this question (see comments near the bottom), I was wondering if anyone knows
Per the documentation , String.Format will throw a FormatException if either (A) the format
I have built a service with ServiceStack (customer example) as per this link: https://docs.google.com/present/view?id=dg3mcfb_213gsvvmmfk
I want to use each io_service per worker thread design in my program. But
I am currently in the process of developing a Web Service which should expose
I'm using a WCF service which needs to be a per call service to
Suppose I have a WCF service that is not session or singleton based and
Is there a way to set a different value for service startup timeout per

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.