BuildQuery A Simple SQL Query Tool
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BuildQuery
{
/// <summary>
/// 使用提供的数据建立一个SQL查询
/// </summary>
public class BuildQuery
{
#region 类的变量
int numFieldsCount, dispos; //字段数量,记录逗号的数量
//
//将所有的字段和值放入到Dictionary集合里,提高操作效率
//
Dictionary<string, string> dicFields = new Dictionary<string, string>(); //字段集合
Dictionary<string, string> dicData = new Dictionary<string, string>(); //值的集合
Dictionary<string, bool> dicQuotes = new Dictionary<string, bool>(); //是否需要引号的集合
//
//条件字段及值的集合
//
List<string> listIDFields = new List<string>(); //字段集合
List<string> listIDValues = new List<string>(); //值的集合
List<bool> listIDQuotes = new List<bool>(); //引号集合
List<string> listIDOperators = new List<string>();//操作符集合
string strTable; //表名
Boolean IdentityCheck; //是否需要返回一个新的实体类
/// <summary>
/// 封装一个是否需要新的实体类
/// </summary>
public Boolean GetIdentity
{
get { return IdentityCheck; }
set { IdentityCheck = value; }
}
/// <summary>
/// 封装返回一个查询的结果
/// </summary>
public string Table
{
get { return strTable; }
set { strTable = value; }
}
#endregion
/// <summary>
/// 类的实例化构造方法
/// </summary>
public BuildQuery()
{
}
/// <summary>
/// 建立一个查询前清除DICTIONARY集合的所有内容
/// </summary>
publ
相关文档:
using (con)
{
con.Open();
String sqltext = "select * from emp where empno=@empno";
......
#region 得到所有本地网络中可使用的SQL服务器列表
/// <summary>
/// 得到所有本地网络中可使用的SQL服务器列表
/// </summary>
/// <param name="p_strServerList">服务器列表</param& ......
SQL 注入攻击原理及防护
在确认可以注入的情况下,使用下面的语句:
HTTP://www.163.com/news.asp?id=xx ;and (select count(*) from sysobjects)>0
HTTP://www.163.com/news.asp?id=xx ;and (select count(*) from msysobjects)>0
如果数据库是SQLServer,那么第一个网址的页面与原页面HTTP://www.163.com/news.asp? ......
[转载]http://www.cnblogs.com/cn_wpf/,非常感谢Nineteen@newsmth 的分分享。
写有效率的SQL查询(I)
大型系统的生产环境,一般情况下,我们评价一条查询是否有效率,更多的是关注逻辑IO(至于为什么,回头补一篇)。我们常说,“要建彪悍的索引”、“要写高效的SQL”,其实最终目的就是在相 ......
1.分析系统日志,一行一行看着实在累人,很多无关日志,能过滤下就好了。文本工具功能实在有限,于是乎,将windows系统日志导入sql server中,直接sql之……。实验了几把,最好的是,直接将系统日志导出为文本的,直接tab分割的,导入sql的时候:
新建数据库->导入数据->下一步->数据源选择文本文件- ......