sql server 表、存储过程数据脚本生成组件
调用实例
string connstr = ConfigurationManager.ConnectionStrings["Finanziamenti"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
// try
// {
#if DEBUG
string dbName = "Finanziamenti";//数据库名
string tableName = "PersonalInfo$PersonalInfo";//表名
string procName = "DB_Rilevazione_Giorno_Update";//储存过程名
string fileName = Server.MapPath("./") + "file/00000001.all.sql";//生成文件名
string packName = "deploy.database.prestiti." + DateTime.Now.ToString("yyyyMMdd");//压缩包文件名
#else
if (!IsPostBack)
{
Response.Write(" sql 脚本自动生成工具 v0.0001</br>选择要更新的站点");
}
else
{
string tdbName = Request.Form["dbName"];
string ttableName = Request.Form["tableName"];
string ttprocName = Request.Form["procName"];
string tfileName = Request.Form["fileName"];
string tpackName = Request.Form["packName"];
//if (string.IsNullOrEmpty(tdbName) || string.IsNullOrEmpty(ttableName) || string.IsNullOrEmpty(ttprocName))
//{
// Msg = "error parameter from dbname or tablename or procname";
// //goto Over;
//}
//string dbName = tdbName;
//string tableName = ttableName;
//string procName = ttprocName;
//string fileName = tfileName;
//string packName = tpackName;
#endif
SqlDataTool.AutoSqlData sqldata = new SqlDataTool.AutoSqlData(dbName, tableName, procName, fileName, packName);
sqldata.connstr = this.connstr;
sqldata.DoWork();
Response.Write(sqldata.Msg);
下载地址