自动生成数据库字典(sql2008)
作者:网络转载 发布时间:[ 2014/10/8 11:06:40 ] 推荐标签:数据库 SQL
当然这些通过PRING出来的代码使用传统的方式是调用不到的,通过查找资料,终于在国外一个XXX网站找到了解决方案。
private static string message = "";
public static string ExecuteNonQuery(string connextionString, CommandType commandType, string commandText, bool outputMsg)
{
if (connextionString == null || connextionString.Length == 0) throw new ArgumentNullException("connectionString");
// Create & open a SqlConnection, and dispose of it after we are done
using (SqlConnection connection = new SqlConnection(connextionString))
{
message = "";
connection.Open();
connection.InfoMessage += delegate(object sender, SqlInfoMessageEventArgs e)
{
message += " " + e.Message;
};
// Call the overload that takes a connection in place of the connection string
if (connection == null) throw new ArgumentNullException("connection");
// Create a command and prepare it for execution
SqlCommand cmd = new SqlCommand(commandText, connection); ;
cmd.CommandType = commandType;
// Finally, execute the command
int retval = cmd.ExecuteNonQuery();
// Detach the SqlParameters from the command object, so they can be used again
cmd.Parameters.Clear();
connection.Close();
return message;
}
}
调用不用写了嘛。一切这么简单,生成的是一份标准的htm代码,可直接放到HTML里面,当然也可以直接从数据库读取出来显示。
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。
相关推荐
在测试数据库性能时,需要注意哪些方面的内容?测试管理工具TC数据库报错的原因有哪些?怎么解决?数据库的三大范式以及五大约束编程常用的几种时间戳转换(java .net 数据库)优化mysql数据库的几个步骤数据库并行读取和写入之Python实现深入理解数据库(DB2)缓冲池(BufferPool)国内三大云数据库测试对比预警即预防:6大常见数据库安全漏洞数据库规划、设计与管理数据库-事务的概念SQL Server修改数据库物理文件存在位置使用PHP与SQL搭建可搜索的加密数据库用Python写一个NoSQL数据库详述 SQL 中的数据库操作详述 SQL 中的数据库操作Java面试准备:数据库MySQL性能优化

sales@spasvo.com