1.关于缓存依赖的测试。if (!IsPostBack)        {            //System.Web.Caching.SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, "Articles");            string key = "test";            DataTable data = (DataTable)HttpRuntime.Cache[key];            // Check if the data exists in the data cache            if (data == null)            {                string strSql = "select top 5 * from Articles";                // If the data is not in the cache then fetch the data from the business logic tier                data = HMBase.Data.SqlHelper.ExecuteSqlToTable(strSql);                // Create a AggregateCacheDependency object from the factory                AggregateCacheDependency cd = new AggregateCacheDependency();                cd.Add(new SqlCacheDependency("HMWeb", "Articles"));                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object                HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration, CacheItemPriority.High, null);            }            GridView1.DataSource = data;            GridView1.DataBind();        }在此期间一共遇到了两个错误:1:异常信息:无法在配置中找到“HMWeb”数据库。在web.config文件里面配置;节点:system.web节点里面再配置节点:    <caching>
      <sqlCacheDependency enabled="true" pollTime="10000">
        <databases>
          <add name="HMWeb" connectionStringName="ConnectionString" pollTime="10000"/>
        </databases>
      </sqlCacheDependency>
    </caching> 异常2:异常信息:没有为 SQL 缓存通知启用数据库“HMWeb”。那是因为没有注册sql依赖表(也许是生成一些触发器,存储过程之类的东西)注册方法如下:C:\Program Files\Microsoft Visual Studio 9.0\VC>aspnet_regsql.exe -S .\SQL2005 -U sa -P sa-ed -d HMWeb -et -t Articles-s代表server -u代表UserName -p代表password -d代表database数据库 -t代表要对缓存依赖项启用的表名 打开vs2008命令行工具,输入C:\Program Files\Microsoft Visual Studio 9.0\VC>aspnet_regsql.exe -S .\SQL2005 -
U sa -P mima -ed -d HMWeb -et -t Articles为 SQL 缓存依赖项启用该数据库。..已完成。为 SQL 缓存依赖项启用该表。 已完成。C:\Program Files\Microsoft Visual Studio 9.0\VC>
------------------------------------分割线----------------------------------------2.关于powerDesigner 对 sql server2005逆向工程的时候,解决没有备注列(说明列)的方法
打开PDM,Ctrl+R(Update model from DataBase)版本15.1搞了一晚上终于搞出区别来了,为什么Powerdesigner生成的脚本就能自动产生comment列,而sqlserver产生的sql脚本Update Model的时候就不生成呢,发现他的原因就是生成的脚本不一样。 下面是Powerdesigner生成的comment列的脚本execute sp_addextendedproperty 'MS_Description',    '地区编码',   'user', 'dbo', 'table', 'mz_dictX', 'column', 'sAreaCode'go
   而下面的是sql server2005自动生成的脚本 EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'iID' ,  @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'mz_xfdj', @level2type=N'COLUMN',@level2name=N'iID'GO
 综合两个脚本区别,我一个一个试发现。1.首先把@name=N,@value=N等东西全部替换为空2.把sys.替换为空3.把'SCHEMA' 替换为'user' 好了,基本就OK了。
------------------------------------分割线----------------------------------------
3。我以前一般的开发环境安装顺序1.安装系统(360打补丁)2.office20073.SQL2005(选择实例名,也可以默认)。win7下打上sp3补丁,或者已管理员身份运行win7下sql 2005有关问题,见如下帖子。http://topic.csdn.net/u/20100324/10/3e28bd69-cca5-4e49-a58d-268afd584324.html
4.vs2008,补丁(sp1)
------------------------------------分割线----------------------------------------
小虎原创笔记收藏,路过仅以此散技术分而而。。

解决方案 »

  1.   

    怎么上面的代码不换行了。--------------
    if (!IsPostBack)        {            //System.Web.Caching.SqlCacheDependencyAdmin.EnableTableForNotifications(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, "Articles");            string key = "test";            DataTable data = (DataTable)HttpRuntime.Cache[key];            // Check if the data exists in the data cache            if (data == null)            {                string strSql = "select top 5 * from Articles";                // If the data is not in the cache then fetch the data from the business logic tier                data = HMBase.Data.SqlHelper.ExecuteSqlToTable(strSql);                // Create a AggregateCacheDependency object from the factory                AggregateCacheDependency cd = new AggregateCacheDependency();                cd.Add(new SqlCacheDependency("HMWeb", "Articles"));                // Store the output in the data cache, and Add the necessary AggregateCacheDependency object                HttpRuntime.Cache.Add(key, data, cd, DateTime.Now.AddMinutes(2), Cache.NoSlidingExpiration, CacheItemPriority.High, null);            }            GridView1.DataSource = data;            GridView1.DataBind();        }
      

  2.   

    怎么不格式一下。呵呵呵my blog
    http://ufo-crackerx.blog.163.com/
      

  3.   

    这一行code要怎么看勒、??  接分