File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,54 @@ Documentation is [here](https://directsql.github.io/DirectSQL.Document/doc/).
2323
2424Please try :smile : .
2525
26+ # Examples
27+ ## Example1
28+ ```
29+ public static void example()
30+ {
31+ SqlLiteDatabase db = new SqlLiteDatabase("connectionString_to_yourdb");
32+ db.Process((connection, transaction) =>
33+ {
34+ SqlLiteDatabase.Query(
35+ "select TEST_VAL1,TEST_VAL2 from TEST_TABLE where TEST_VAL1 = @val1",
36+ new (String, object)[] {ValueTuple.Create("@val1","abcdef")},
37+ connection,
38+ transaction,
39+ (result) => {
40+ while (result.Next())
41+ {
42+ var resultValues = result.ResultValues;
43+ Console.Out.WriteLine("TEST_VAL1:" + resultValues.TEST_VAL1);
44+ Console.Out.WriteLine("TEST_VAL2:" + resultValues.TEST_VAL2);
45+ }
46+ }
47+ );
48+ });
49+ }
50+ ```
51+
52+ ## Example2
53+ ```
54+ public static void example2()
55+ {
56+ SqlLiteDatabase db = new SqlLiteDatabase("connectionString_to_yourdb");
57+ db.Process((connection, transaction) =>
58+ {
59+ dynamic[] resultArray =
60+ SqlLiteDatabase
61+ .LoadSqlResult(
62+ "select TEST_COL1,TEST_COL2 from TEST_TABLE",
63+ connection,
64+ transaction);
65+
66+ Console.Out.WriteLine("TEST_VAL1:" + resultArray[0].TEST_VAL1);
67+ Console.Out.WriteLine("TEST_VAL2:" + resultArray[0].TEST_VAL2);
68+
69+ });
70+ }
71+ ```
72+
73+
2674# How to Build
2775````
2876 git clone git@github.com:DirectSQL/DirectSQL.git
You can’t perform that action at this time.
0 commit comments