LINQpad's - lprun.exe -ctname refresh context

I've started to use LINQPad recenty and I'm quite impressed of it's capabilities. I have a little problem running lprun.exe. Does enyone know if there is a way to refresh data context when using lprun.exe -ctname?
When I run my created .linq script via lprun.exe database table created a little bit earlier from outside of the script is not "visible" to it.



  • Options
    LINQPad should automatically rebuild the data context if the schema has changed since it was last run. I take it you're using an automatically generated data context?
  • Options
    Hi Joe,

    Yes, that is correct. I'm trying to write automated mechanism for db scripts execution. What I do is:
    1. Create connection to database via LINQPad, and rename it to lets say: ctx
    2. Run powershell script that executes all .sql and .linq files in given directory.

    The command that I use to execute .linq is" lprun -lang=Program -cxname=ctx scriptFileName.linq.
    The .linq script files in general are reading data from db and producing .csv reports or amending existing db records.
    This works till the moment one of the .linq script tries to update the table that has been created one step before by executing .sql file.
    I found out that this table is not visible to .linq script. When I open LINQPad and refresh context the script executes with no problems. Is this correct behaviour?

Sign In or Register to comment.