SQLiteHelper

from:http://www.eggheadcafe.com/articles/20050315.asp

And here is a Quasi "help document" in the NDoc LinearHTML format:

public class SQLiteHelper

SQLiteHelper is a utility class similar to "SQLHelper" in MS Data Access Application Block and follows similar pattern.

Method Members

Name Access Summary
AssignParameterValues() : Void protected This method assigns dataRow column values to an array of IDataParameters
AssignParameterValues() : Void protected This method assigns an array of values to an array of IDataParameters
AssignParameterValues() : Void familyOrAssembly This method assigns dataRow column values to an IDataParameterCollection
CreateCommand() : SQLiteCommand public Creates the command.
CreateCommand() : SQLiteCommand public Creates the command.
CreateParameter() : SQLiteParameter public Creates the parameter.
DeriveParameters() : SQLiteParameterCollection public Parses parameter names from SQL Statement, assigns values from object array , and returns fully populated ParameterCollection
ExecuteDataset() : DataSet public Executes the dataset from a populated Command object.
ExecuteDataSet() : DataSet public Shortcut method to execute dataset from SQL Statement and object[] arrray of /// parameter values
ExecuteDataset() : DataSet public Executes the dataset in a SQLite Transaction
ExecuteDataset() : DataSet public Executes the dataset with Transaction and object array of parameter values.
ExecuteDataSet() : DataSet public Shortcut method to execute dataset from SQL Statement and object[] arrray of parameter values
ExecuteNonQuery() : Int32 public
ExecuteNonQuery() : Int32 public Executes non-query sql Statment with Transaction
ExecuteNonQuery() : Int32 public Executes the non query.
ExecuteNonQuery() : Int32 public Shortcut to ExecuteNonQuery with SqlStatement and object[] param values
ExecuteNonQueryTypedParams() : Int32 public Executes non query typed params from a DataRow
ExecuteReader() : IDataReader public ShortCut method to return IDataReader NOTE: You should explicitly close the Command.connection you passed in as well as call Dispose on the Command after reader is closed. We do this because IDataReader has no underlying Connection Property.
ExecuteScalar() : Object public Shortcut to ExecuteScalar with Sql Statement embedded params and object[] param values
ExecuteXmlReader() : XmlReader public Execute XmlReader with complete Command
UpdateDataset() : Void public Executes the respective command for each inserted, updated, or deleted row in the DataSet.

To use this, download the SQLiteHelper.cs class and the CHM documentation in the zip file below, and ADD the SQLiteHelper.cs class file to the ADO.NET provider source code project, and rebuild it. Done! Now you have SQLite.Net ADO.NET provider with a familiar, built-in SQLiteHelper class should you need it. Feel free to improve if you are so inclined.

N.B. I just checked the sourceforge.net site and it looks like Robert fixed a bug in the Command class. So I've gotten the new source and compiled a release build of SQLite.NET.dll as of 3/17/2005. It includes my SQLiteHelper class and is in the zip file below.

 

Download the source code that accompanies this article

你可能感兴趣的:(sqlite)