Skip to content

Commit 0f15ebd

Browse files
committed
Added an example to document
1 parent d7eee8c commit 0f15ebd

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

DirectSQL/doc/articles/intro.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# See code of TestSqlLiteDatabase as an example
1+
# An example
2+
3+
```
4+
public static void example()
5+
{
6+
SqlLiteDatabase db = new SqlLiteDatabase("connectionString_to_yourdb");
7+
db.Process((connection, transaction) =>
8+
{
9+
SqlLiteDatabase.Query(
10+
"select TEST_VAL1,TEST_VAL2 from TEST_TABLE where TEST_VAL1 = @val1",
11+
new (String, object)[] {ValueTuple.Create("@val1","abcdef")},
12+
connection,
13+
transaction,
14+
(result) => {
15+
while (result.Next())
16+
{
17+
var resultValues = result.ResultValues;
18+
Console.Out.WriteLine("TEST_VAL1:" + resultValues.TEST_VAL1);
19+
Console.Out.WriteLine("TEST_VAL2:" + resultValues.TEST_VAL2);
20+
}
21+
}
22+
);
23+
});
24+
}
25+
```
26+

0 commit comments

Comments
 (0)