解决方案 »

  1.   

    XP装了数据库了没有? 连接数据库字符串最好写上机器名称\sqlexpress
      

  2.   


    装了sql 2005 ,  试过给写上机器的名称 但出现同样问题!
      

  3.   

    你链接字符串不对啊,已存在同名的数据库,说明之前已经附加成功过了,这里的链接只用Integrated Security=false;uid=帐号;password=密码;Persist Security Info=False;Initial Catalog=数据库名称;Data Source=数据库地址;TimeOut=30;
      

  4.   

    你把mdf附加到sql2005里面然后写字符串
    <add key="ConnectionString" value="data source=你的pc名称\sqlexpress;User ID=sa;pwd=sa;Initial Catalog=hometown;" />
    这样应该没问题