标签:
/// <summary> /// 获取数据库名称 /// </summary> /// <param name="Account">帐套号</param> /// <returns></returns> public static string GetDBName(string Account) { StringBuilder strSql = new StringBuilder(); strSql.Append(" select name from master..sysdatabases where name like‘%UFDATA_%‘ "); DataSet ds = DbHelperSQL.Query(strSql.ToString()); int count = ds.Tables[0].Rows.Count; string DbName = string.Empty; if (count > 0) { for (int i = 0; i < count; i++) { DbName = ds.Tables[0].Rows[i]["name"].ToString(); string TempDbName = DbName.Substring(7, 3); if (Account == TempDbName) { return DbName; } } } return DbName; }
标签:
原文地址:http://www.cnblogs.com/akonlei/p/5622320.html