https://github.com/rhildred/dotnetsqlite
the example from microsoft with a readme that covers Jade
https://github.com/rhildred/dotnetsqlite
Last synced: about 1 year ago
JSON representation
the example from microsoft with a readme that covers Jade
- Host: GitHub
- URL: https://github.com/rhildred/dotnetsqlite
- Owner: rhildred
- Created: 2020-06-09T17:13:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-09T17:56:51.000Z (about 6 years ago)
- Last Synced: 2025-02-17T12:45:21.111Z (over 1 year ago)
- Language: C#
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dotnetsqlite
The [example from microsoft](https://docs.microsoft.com/en-us/dotnet/standard/data/sqlite/?tabs=visual-studio) with a readme that covers [Jade](https://rhildred.github.iol/jade).
In this repo do `dotnet run`. The first time you will get this error but it will create the hello.db file in the current folder:
```
Unhandled exception. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such table: user'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
at Jun9sqlitedotnet.Program.Main(String[] args) in /Volumes/esgaroth/source/repos/Jun9sqlitedotnet/Program.cs:line 24
```
1. Open the hello.db using the [Jade editor](https://rhildred.github.io) and create the user table with a row to satisfy this sql:
```
command.CommandText =
@"
SELECT name
FROM user
WHERE id = $id
";
```
2. Save the hello.db from Jade into your Downloads folder.
3. Move it over top of the hello.db that you copied in step 1.
4. `dotnet run` and you should see something like:
```
rhildred@Richs-Mac-mini Jun9sqlitedotnet % dotnet run
Hello, Rich!
rhildred@Richs-Mac-mini Jun9sqlitedotnet %
```