ADO.
NET
Overview to [Link]
Operations when accessing databases:
- Connecting to a database
- Selecting records from tables
- Modifying data in tables
Overview to [Link]
Connection
Command
DataReader DataAdapter
DataTable
DataRow
TASKS
Looking up the database... Modifying the database...
Create and open the Connection to the Database
SQLiteConnection conn = new
SQLiteConnection("Data Source=" + DBpath +
";Version=3;")
[Link]();
Create a Command
SQLiteCommand comm = new SQLiteCommand(query,
conn);
Create a DataReader
SQLiteDataReader reader = [Link]();
Create a DataTable
DataTable dt = new DataTable();
[Link](reader);
Display the records of the foreach(DataRow dr in [Link])
DataTable {
}
Close the DataReader
Close the Connection to the Database
Create a DataAdapter, and
pass the Command to the
DataAdapter
SQLiteDataAdapter da = new SQLiteDataAdapter();
[Link] = comm;
[Link]();
[Link] = comm;
[Link]();
[Link] = comm;
[Link]();
Close the Connection to the Database