Esempio n. 1
0
        /// <summary>
        /// 获取某对应项对应的数据库脚本。
        /// </summary>
        /// <param name="objName">对象名称</param>
        /// <returns></returns>
        internal static string GetGridConfigScript(string objName)
        {
            StringBuilder sb = new StringBuilder();
            MDataTable    dt = GridConfig.GetList(objName, GridConfig.SelectType.All);

            if (dt != null)
            {
                dt.Columns.RemoveAt(0);//移除主键
                sb.Append("Delete from Config_Grid where ObjName='" + objName + "'\r\nGo\r\n");
                //创建SQL脚本。
                foreach (var row in dt.Rows)
                {
                    row.TableName = "Config_Grid";
                    sb.AppendLine(GetSQLScript(row, "ObjName", "Field"));
                }
            }
            return(sb.ToString());
        }