11# PowerQueryNet
2- Run Power Query M formula language from .NET (C#)
2+ Run Power Query M formula language from anywhere.
33
44## About
5- PowerQueryNet allows you to run M formulas commonly used in Power BI and Excel (aka Get & Transform) from any .NET application.
5+ PowerQueryNet allows you to run M formulas commonly used in Power BI and Excel (aka Get & Transform) from the Command Prompt or any .NET application.
66
77## Download
88
@@ -14,15 +14,29 @@ Dependency: [PowerQuerySdk.vsix 1.0.0.16](http://dakahn.gallery.vsassets.io/_api
1414
1515Samples: [ PowerQueryNet.Samples.zip] ( ../../releases/download/v1.0.3/PowerQueryNet.Samples.zip )
1616
17- ## Hello, World!
17+ ## Hello, World! - Command line interface
1818
19- 1 . Install ` PowerQueryNet.msi `
20- 2 . From your .NET project, add a reference to ` PowerQueryNet.Client `
21- 3 . Run the following:
19+ 1 . Create a new file with the following content:
2220``` txt
23- var q = new Query { Formula = "let hw = \"Hello World\" in hw" };
24- var pq = new PowerQueryCommand();
25- var result = pq.Execute(q);
21+ let Source = "Hello, World!" in Source
22+ ```
23+ 2 . Save the file as helloworld.pq
24+ 3 . Run the following in the Command Prompt:
25+ ``` txt
26+ pqnet helloworld.pq
27+ ```
28+
29+ ## Hello, World! - .NET (C#)
30+
31+ 1 . From your .NET project, add a reference to ` PowerQueryNet.Client `
32+ 2 . Run the following:
33+ ``` txt
34+ var qry = new Query { Formula = "let hw = \"Hello World\" in hw" };
35+ var req = new ExecuteRequest();
36+ req.Queries.Add(qry);
37+ req.ExecuteOutputFlags = ExecuteOutputFlags.DataTable;
38+ var pqc = new PowerQueryCommand();
39+ var result = pqc.Execute(req);
2640DataTable dt = result.DataTable;
2741```
2842## Power Query App
@@ -37,6 +51,6 @@ To build the Setup project, [WiX Toolset](http://wixtoolset.org/releases/) must
3751
3852## Copyright
3953
40- Copyright 2018
54+ Copyright 2019
4155
4256Licensed under the [ MIT License] ( LICENSE )
0 commit comments