工厂模式的数据库连接
摘要:/// 数据连接字符串 /// private static string connectionString; /// /// 数据库 驱动 提供者 /// private static string providerName; /// /// 数据库 驱动 提...
阅读全文
posted @
2008-03-18 17:14
阿春
阅读(258)
推荐(0)
执行查询语句
摘要:public static DataTable Select(string sql) { using (DbConnection conn = factory.CreateConnection()) { try { conn.Co...
阅读全文
posted @
2008-03-18 15:47
阿春
阅读(170)
推荐(1)
给一个文本 和 编码类型 转换成 规定类型的 URL 编码
摘要:给一个文本 和 编码类型 转换成 规定类型的 URL 编码 public static string GetUrlEncode(string s, System.Text.Encoding e) { if (s.Trim() != "") { return HttpUtility.Ur...
阅读全文
posted @
2008-03-16 23:52
阿春
阅读(246)
推荐(0)
C#采集器
摘要:http://www.cnblogs.com/duoe/archive/2007/12/16/996664.html
阅读全文
posted @
2008-03-07 17:07
阿春
阅读(535)
推荐(0)
ss
摘要:HtmlWeb hw = new HtmlWeb(); hw.DefaultEncoding = System.Text.Encoding.GetEncoding("gb2312"); string url = @"http://bbs.99read.com"; HtmlDocument doc = hw.Load(url);...
阅读全文
posted @
2008-03-06 23:48
阿春
阅读(326)
推荐(0)
防止注入的sql调用
摘要:int KeChengHao = int.Parse(this.textBox1.Text.Trim()); System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("Data Source=127.0.0.1;Initial Catalog=Student;Use...
阅读全文
posted @
2008-03-01 23:34
阿春
阅读(160)
推荐(0)
程序调用sql
摘要://// delete from 课程表 where 课程号=1 or 1=1 string sql = this.textBox1.Text.Trim(); System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("Data Source=...
阅读全文
posted @
2008-03-01 23:33
阿春
阅读(166)
推荐(0)
程序调用存储过程
摘要://exec Delete_kc 6 int KeChengHao = int.Parse(this.textBox1.Text.Trim()); System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("Data Source=127.0....
阅读全文
posted @
2008-03-01 23:31
阿春
阅读(186)
推荐(0)