Outputting SQL statements in Console app - miniprofiler

We have our code instrumented so that in our MVC5 application, we can see the actual executed SQL. We show the information using #MiniProfiler.RenderIncludes() on our _layout.cshtml file. We configure miniprofiler as below
MiniProfiler.Settings.SqlFormatter = new InlineFormatter();
MiniProfiler.Start();
We want to use miniprofiler in our batch console applications to show the actual executed SQL. We were looking at using Windows.Miniprofiler nuGet package, but it won't work with the current miniprofiler version of 3.2.0.157.
When we try to look at the results using below code, the SQL statements are not shown.
var friendlyString = MiniProfiler.Current.Render();
Any suggestions on how to do this?

Related

How to generate Data Matrix Barcode from Nav 2015?

I searched a lot regarding the Data Matrix Code generation from Nav 2015 but could not get any proper solution for that though, i got some code from below link but still, some of the automation variables is not there in Navision, so I need you guys help on this, is there any Code Unit or any object or any other way in Nav..
http://www.barcode-soft.com/dynamics-nav-barcode.aspx
It depends on how much time you have to get the barcode.
If it's a back end job, like a report, you can call a command line tool to create the barcode and import the generated image file into a BLOB of a table variable. This table field is then printable within the report.
Another way I use in production is running a web service that creates the barcode and then let Navision create a web page that is opened in a browser window..
I suggest using a dll (written in C# with ZXING.NET) to generate it and then importing it in NAV.

SAS Enterprise Guide - Get Code from Process flow

I was wondering if there is a easy and fast way to get the code from the programs that I have created in SAS Enterprise Guides process flow?
I am creating the program in SAS Enterprise Guide, and then creating a script for later usage in SAS, as I am not strong enough to program it from scratch.
At the moment, I am opening each step and copying the code, but there must be a faster way.
Any suggestions?
Thanks
This is an option in the File menu:
File -> Export -> Export all Code in Process Flow
If you rename the file from an EGP to a .zip and then open the file you'll see you have folders relating to objects in the EG project.
You can then pull extract these pieces of SAS code and rename as necessary.
I've also seen some software which can examine EGP files if you do a search.
This has been updated instead of File -> Export -> Export all Code in Process Flow.
You can find this under the Share button in the Process Flow tab.
Share -> Export all Code in Process Flow

Prompting for SAS ODBC connection password when running in batch mode

For various reasons I prefer to run my SAS programs in batch mode as much a possible. And for security reasons I'd prefer to have SAS prompt me for a password whenever making and ODBC connection to a Teredata warehouse. Can I have both of these things at once?
The following code works fine when run from SAS interactively, but won't create a prompt when run in batch.
proc sql;
connect to odbc (prompt);
quit;
Anyone know of a way make this work? (Also, I'm looking for a solution specifically using the connect statement; SAS/ACCESS libname methods of reaching the Teradata aren't available to me.)
I'm not sure that it's possible to have a batch program prompt you. However, you could solve the problem by making the password (or any part of the connection string or the whole string) a parameter you pass to SAS when you run the batch program, using SYSPARM.
Then you can type the password in the command line when you execute the program. You could easily do something like include a "%1" parameter in your normal "run SAS batch" program, or write a custom one for this use case.
If you like to run things by right-click menu run, you could solve it by writing a VB Script or a Powershell script (Windows), or a similar script in Unix, that opens a prompt window (via the OS) to get the parameter, then runs the program in batch (and then add that to the right-click menu).

Execute code at runtime with ASP.Net 5

I am using Asp.Net 5 CTP6.
I need to execute some c# code at runtime. I know there is some solution and I used some of them but I want to know how can I do this by Roslyn because of platform independency?
By the old solution that I found may be exists some problems about multi platform independency. In fact I want to run the web app on windows and Ubuntu.
Thanks
Please see the following code :
string s = #"
using .....
string a=""this is a test :)""
";
SomeMethodToRunTheCode(s);
In asp.net webform I can attach the code to an .ascx (at runtime I create a file with .ascx extension and I append the code to the file ) file then with LoadControl method I will be able to run the codes at runtime. but in the asp.net 5 ( vNext ) I do not know how can I do this.
Take a look at how razor does it https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs

How to test ILOG JRules Ruleset without using DVS?

I'm trying to use JRules BRMS 7.1 for a project. And I found out that DVS has some limitation in testing Ruleset.
It is that it cannot test the content in collections of complex type in Excel scenario file templates.
But I understand it is normal as that kind of content is too complex for an Excel table format.
So anyone has any idea what is the best way to test a ruleset that need tons of test cases with lots of complex type input without using DVS?
If developers are doing the testing, then use JUnit with an embedded rule engine. If non-technical users need to perform testing, it may be simplest to upgrade to WODM 7.5 which does not have this limitation. If that is not an option, then it is possible to use JRules 7.1 DVS, but it is somewhat complex and involves creating a separate wrapper rule project that takes the output collections as input and in its XOM, performs the comparison with the actual results.
Raj Rao is correct, you can use array as expected results (input is easy) but you will have to use hidden JRules API and it is painful anyway.
JUnit or 7.5 is the answer.
Unless you want to pay IBM to do it, even so they may say it is not possible because it is not detailled anywhere :(
Cheers
PS: BTW, arrays of complex types as input is easy for sure and well documented, I think.
If you have deployed your rules as a HTDS service to RES, then you could use SoapUI to test the HTDS web service.
SoapUI allows you to set up test cases that can be used to test different scenarios.
To validate the rules using Decision Validation Services, you create an Excel scenario file template that you populate with scenarios to test.
Before generating the Excel scenario file template, you must check that your project does not contain any errors or warnings that could prevent the generation of the Excel file.
step1:in your rule explorer select your project in rule project enable the dvs part click check point and make sure that you don't have any errors.
2:create scenario file click next give the name for test project name.xls.
3:pass the values in scenario and expected results in expected results column.
4:you can test multiple scenarios at a time.
5:now close and save the excel file.
6:run configuration right click dvs excel file give any name for test
7:in excel file field click browse and select xls file
8.in rule project field select your rule project
9:in HTML report field select your project and click OK.
10:click apply and run
11:in rule studio right click on your project and click refresh
12:the HTML file will be generated in project.
13:right click and open with web browser and observe the result of your scenarios.
14:you have successfully enabled dvs