没有合适的资源?快使用搜索试试~ 我知道了~
C#_SQLite操作类库
5星 · 超过95%的资源 需积分: 45 75 下载量 200 浏览量
2010-09-28
18:06:57
上传
评论 1
收藏 23KB TXT 举报
温馨提示
试读
25页
using System; using System.Collections; using System.Collections.Specialized; using System.Data; using System.Data.SQLite;//这个可以去网上下载 using System.Configuration; public class SQLiteHelper { //数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库. public static string connectionString = "Data Source=" + System.Web.HttpContext.Current.Server.MapPath( ConfigurationManager.AppSettings["SQLString"]); public SQLiteHelper() { } #region 公用方法
资源推荐
资源详情
资源评论
/**************************************
* 作用:SQLLite Server操作实现
* 作者:Nick.Yan
* 日期: 2009-03-29
* 网址:www.redglove.net
**************************************/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SQLite;//这个可以去网上下载
using System.Configuration;
public class SQLiteHelper
{
//数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库.
public static string connectionString = "Data Source=" +
System.Web.HttpContext.Current.Server.MapPath(
ConfigurationManager.AppSettings["SQLString"]);
public SQLiteHelper() { }
#region 公用方法
public static int GetMaxID(string FieldName, string TableName)
{
string strsql = "select max(" + FieldName + ")+1 from " + TableName;
object obj = GetSingle(strsql);
if (obj == null)
* 作用:SQLLite Server操作实现
* 作者:Nick.Yan
* 日期: 2009-03-29
* 网址:www.redglove.net
**************************************/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SQLite;//这个可以去网上下载
using System.Configuration;
public class SQLiteHelper
{
//数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库.
public static string connectionString = "Data Source=" +
System.Web.HttpContext.Current.Server.MapPath(
ConfigurationManager.AppSettings["SQLString"]);
public SQLiteHelper() { }
#region 公用方法
public static int GetMaxID(string FieldName, string TableName)
{
string strsql = "select max(" + FieldName + ")+1 from " + TableName;
object obj = GetSingle(strsql);
if (obj == null)
{
return 1;
}
else
{
return int.Parse(obj.ToString());
}
}
public static bool Exists(string strSql)
{
object obj = GetSingle(strSql);
int cmdresult;
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
cmdresult = 0;
}
else
{
cmdresult = int.Parse(obj.ToString());
}
if (cmdresult == 0)
{
return false;
}
else
{
return true;
}
}
return 1;
}
else
{
return int.Parse(obj.ToString());
}
}
public static bool Exists(string strSql)
{
object obj = GetSingle(strSql);
int cmdresult;
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
cmdresult = 0;
}
else
{
cmdresult = int.Parse(obj.ToString());
}
if (cmdresult == 0)
{
return false;
}
else
{
return true;
}
}
剩余24页未读,继续阅读
yaleye123
- 粉丝: 18
- 资源: 36
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页