资源简介
自己写的SQLite数据操作的简单例子。
有Datagridview,treeView和listView三个作为显示数据。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;
using System.Data;
using System.Configuration;
namespace SQLiteHelper
{
public class SQLiteHelper
{
#region SQlite数据操作
///
/// 执行SQl语句 返回执行的行数
///
/// 链接数据库的字符串
/// sql执行语句
/// 参数
public static int SQLiteCommand(string str string SqlString params SQLiteParameter[] Param)
{
try
{
SQLiteConnection slcn = new SQLiteConnection(str);
SQLiteCommand slcmd = slcn.CreateCommand();
PrepareCommand(slcmd slcn null SqlString Param);
return slcmd.ExecuteNonQuery();
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
}
///
/// 执行SQl语句 返回DataSet
///
/// 链接数据库的字符串
/// sql执行语句
/// 参数
/// DataSet
public static DataSet SQLiteCommandDataSet(string str string SqlString params SQLiteParameter[] Param)
{
try
{
DataSet ds = new DataSet();
SQLiteConnection slcn = new SQLiteConnection(str);
SQLiteCommand slcmd = slcn.CreateCommand();
PrepareCommand(slcmd slcn null SqlString Param);
SQLiteDataAdapter sda = new SQLiteDataAdapter(slcmd);
slcmd.Parameters.Clear();
sda.Fill(ds);
sda.Dispose();
return ds;
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new Exception(ex.Message);
}
}
///
/// 执行SQl语句 返回数据集SQLiteDataReader
///
/// 链接数据库的字符串
/// sql执行语句
/// 参数
/// SQLiteDataReader
public static SQLiteDataReader SQLiteCommandDataReader(string str string SqlString params SQLiteParameter[] Param)
{
try
{
SQLiteConnection slcn = new SQLiteConnection(str);
SQLiteCommand slcmd = slcn.CreateCommand();
PrepareCommand(slcmd slcn null SqlString Param);
SQLiteDataReader myReader = slcmd.ExecuteReader();
slcmd.Parameters.Clear();
return myReader;
}
catch (System.Data.SQLite.SQLiteException ex)
{
throw new
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5632 2011-11-27 20:21 TestSQLiteFunction\SQLiteHelper\bin\Debug\SQLiteHelper.dll
文件 13824 2011-11-27 20:21 TestSQLiteFunction\SQLiteHelper\bin\Debug\SQLiteHelper.pdb
文件 839680 2008-10-02 09:02 TestSQLiteFunction\SQLiteHelper\bin\Debug\System.Data.SQLite.DLL
文件 5930 2011-11-27 20:21 TestSQLiteFunction\SQLiteHelper\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 4811 2011-11-27 16:39 TestSQLiteFunction\SQLiteHelper\obj\Debug\ResolveAssemblyReference.cache
文件 662 2011-11-27 17:06 TestSQLiteFunction\SQLiteHelper\obj\Debug\SQLiteHelper.csproj.FileListAbsolute.txt
文件 5632 2011-11-27 20:21 TestSQLiteFunction\SQLiteHelper\obj\Debug\SQLiteHelper.dll
文件 13824 2011-11-27 20:21 TestSQLiteFunction\SQLiteHelper\obj\Debug\SQLiteHelper.pdb
文件 1380 2011-11-27 15:49 TestSQLiteFunction\SQLiteHelper\Properties\AssemblyInfo.cs
文件 4221 2011-11-27 20:19 TestSQLiteFunction\SQLiteHelper\SQLiteHelper.cs
文件 2425 2011-11-27 16:39 TestSQLiteFunction\SQLiteHelper\SQLiteHelper.csproj
文件 14336 2011-11-27 21:01 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\library.db
文件 5632 2011-11-27 20:21 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\SQLiteHelper.dll
文件 13824 2011-11-27 20:21 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\SQLiteHelper.pdb
文件 839680 2008-10-02 09:02 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\System.Data.SQLite.DLL
文件 11776 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\TestSQLiteFunction.exe
文件 28160 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\TestSQLiteFunction.pdb
文件 11608 2011-11-27 20:55 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\TestSQLiteFunction.vshost.exe
文件 490 2010-03-17 22:39 TestSQLiteFunction\TestSQLiteFunction\bin\Debug\TestSQLiteFunction.vshost.exe.manifest
文件 3283 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\Form1.cs
文件 5999 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\Form1.Designer.cs
文件 5817 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\Form1.resx
文件 6395 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 566 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\GenerateResource-ResGen.read.1.tlog
文件 958 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\GenerateResource-ResGen.write.1.tlog
文件 7903 2011-11-27 20:21 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\ResolveAssemblyReference.cache
文件 1518 2011-11-27 20:55 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\TestSQLiteFunction.csproj.FileListAbsolute.txt
文件 11776 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\TestSQLiteFunction.exe
文件 180 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\TestSQLiteFunction.Form1.resources
文件 28160 2011-11-27 20:53 TestSQLiteFunction\TestSQLiteFunction\obj\x86\Debug\TestSQLiteFunction.pdb
............此处省略31个文件信息
相关资源
- 在线词典项目v1.1.zip
- PHP MySQL 物流管理 数据库文件
- 4秒100万条数据导入SQL数据库
- php mysql 在线作业管理系统
- pb 酒店管理系统(代码、sql数据库)
- [PHP MySQL]图书馆管理系统前后台全部代
- sql数据库导出到txt文件
- 人事管理系统数据库文件SQL2000
- 门禁系统论文及数据库sqlserver2005数据
- labview中LABSQL数据库的使用
- C 开发的SQL数据库实现的公司员工信
- 企业人事管理系统【SQLServer数据库+课
- 数据字典导出工具 导出SqlServer数据库
- mysql 数据库连接池
- MySQL数据库用户在线注册系统
- 易语言黑月ADODB数据库操作类1.31版模
- 易语言黑月ADODB数据库操作类1.33版模
- 易语言黑月ADODB数据库操作类1.32版模
- 易语言ADODB数据库类操作
- 实现Oracle数据库每天异地自动备份
- windows下oracle数据库备份压缩删除历史
- 东城大学在线答疑系统struts2+spring带
- mysql数据库驱动8.0.12版本
-
purexm
l:引发数据库技术新一轮革命 -
Syba
se IQ“绿色数据库”构建绿 -
Oracle向Syba
se ASE迁移指南 - 用NetBackup恢复Oracle数据库到异机
- Backup_Exec_ORACLE_RAC_数据库备份恢复指导
- Oracle 10g数据库的安全性和身份管理
- oracle数据库比对工具
评论
共有 条评论