易截截图软件、单文件、免安装、纯绿色、仅160KB

通用的SqlServer操控类

 using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;


public class CommandInfo
{
public string CommandText;
public SqlParameter[] Parameters;
}
/// <summary>
/// 数据访问抽象基础类
/// </summary>
public abstract class DbHelperSQL
{
//数据库连接字符串(web.config来配置),可以动态更改connectionString支持多数据库.
public static string connectionString = ConfigurationManager.ConnectionStrings["cnpg_newsConStr"].ToString();


public DbHelperSQL()
{


}
#region 公用方法
public static int GetMaxID(string FieldName, string TableName)
{
string strsql = "select max(" + FieldName + ")+1 from " + TableName;
object obj = DbHelperSQL.GetSingle(strsql);
if (obj == null)
{
return 1;
}
else
{
return int.Parse(obj.ToString());
}
}
public static bool Exists(string strSql)
{
object obj = DbHelperSQL.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;
}
}
/// <summary>
/// 表是否存在
/// </summary>
/// <param name="TableName"></param>
/// <returns></returns>
public stati


相关文档:

ORACLE临时表和SQLSERVER临时表异同

 SQL SERVER临时表
也可以创建临时表。临时表与永久表相似,但临时表存储在 tempdb 中,当不再使用时会自动删除。
有本地和全局两种类型的临时表,二者在名称、可见性和可用性上均不相同。本地临时表的名称以单个数字符号 (#) 打头;
它们仅对当前的用户连接是可见的;当用户从 Microsoft? SQL Server? 2000 实例断 ......

.Net在SqlServer中的图片存取技术

本文总结如何在.Net Winform和.Net webform(asp.net)中将图片存入sqlserver中并读取显示的方法
1,使用asp.net将图片上传并存入SqlServer中,然后从SqlServer中读取并显示出来
一,上传并存入SqlServer
数据库结构
create table test
{
id identity(1,1),
FImage image
}
相关的存储过程
Create proc UpdateImage ......

索引的创建及使用(sqlserver 2005)

索引的创建及使用(sqlserver 2005)
为指定表或视图创建关系索引,或为指定表创建 XML 索引。可在向表中填入数据前创建索引。可通过指定限定的数据库名称,为另一个数据库中的表或视图创建索引。
 Transact-SQL 语法约定
语法
 
Create Relational Index CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] IN ......

SQLSERVER修复小知识

在与数据库打交道的工作中时常会碰到一些数据库的错误,这就涉及到了修复的过程,以下知识点都是从网上收集而来:
1、dbcc checkdb
这个命令恐怕是我们最常用的了,带检查和修复功能
语法格式:
DBCC CHECKDB
[
[ ( database_name | database_id | 0
[ , NOINDEX
| , { REPAIR_ALLOW_DATA_LOS ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号