文章分类 -  ASP.NET

转载:C# 获取数据库表信息与列信息
摘要:conn.Open();string[] restrictions = new string[4];restrictions[1] = "dbo";DataTable table = conn.GetSchema("Tables", restrictions);conn.Close();返回的table是表的所有信息,而不仅仅是名字,可以通过如下语句查看这些信息:foreach (System.Data.DataRow row in table.Rows){foreach (System.Data.DataColumn col in table.Colu 阅读全文

posted @ 2013-09-19 10:54 砖头 阅读(691) 评论(0) 推荐(0)

过滤txt文本数据的空行记录
摘要:在使用bulk insert将txt数据批量导入sqlserver数据时,经常需要判断txt的数据格式,如果txt文本中出现空行,bulk insert进数据库时就会出现“大容量插入: 在数据文件中遇到意外的文件结尾 (EOF)”,写了个函数避免发生类似错误发生。引用空间 using System.Text.RegularExpressions;using System.IO; 程序部分: s... 阅读全文

posted @ 2006-04-10 13:53 砖头 阅读(2262) 评论(0) 推荐(0)

导航