摘要:
#region 生成数据表中数据的脚本public static string CreateDataScript(string tableName){bool isIdEntity=false;//此表中是否有标识列(自增)string commandText = String.Format("SELECT c.name ,biaoshi=COLUMNPROPERTY( c.id,c.name,'IsIdentity') ,t.name "+ "FROM syscolumns c inner join systypes t on c.xuserty 阅读全文
摘要:
public static ArrayList ReturnTableField(string tableName){string sql="SELECT c.name as FieldName FROM SYSCOLUMNS c inner join systypes t on c.xusertype=t.xusertype WHERE c.ID = OBJECT_ID('"+tableName+"')";return DBHelper.ExecuteArrayList(CommandType.Text,sql,0);} 阅读全文
摘要:
public static string GetPrimaryKey(string tableName){ string sql2=String.Format("exec sp_pkeys @table_name='{0}'",tableName); SqlDataReader reader=null;string key = "";try{reader = DBHelper.ExecuteReader(sql2);if(reader != null){while (reader.Read()){key= reader["COL 阅读全文
摘要:
/// <summary>/// 返回某个数据表的结构信息(master数据库)/// </summary>/// <param name="tableName">表名</param>/// <returns>表的结构信息</returns>public static DataTable GetTableInfo(string tableName){string sql1=String.Format("EXEC sp_columns @table_name='{0}'" 阅读全文
摘要:
/// <summary>/// 获得数据库中的表,以及视图/// </summary>public static ArrayList GetDBTableAndView(){ArrayList list;string sql="select name from sysobjects where xtype IN('U','V') and status>0 order by name ";list=ExecuteArrayList(CommandType.Text,sql,0);return list;} 阅读全文
摘要:
1.思路: 使用WebService来实现这一功能,Webservice中放一xml文件,用于存储版本和需要更新的列表.客户端应用程序在每次启动时,访问webservice,检查version,如果版本低则下载xml文件,启动AutoUpdate.exe进行更新.2.步骤:2.1 定义WebService 2.1.1 定义xml文件 <?xml version="1.0" encoding="utf-8" ?> <product> <version>1.0.1818.42821</version> < 阅读全文