http://down2.51aspx.com/jingmeiSchool.rar
总是提示“实例失败”。有可能是源码自身的问题,之前贴出了一些连接代码,也问了许多人都没能解决,所以还是请有心人下载一下看看能不能连上,我知道没有这么帮人的,但也是出于无奈,很喜欢这个源码,谢谢了

解决方案 »

  1.   

    这是web.config的代码,至于你说的连接字符串是写在一个类里的而不在web.config里<?xml version="1.0"?>
    <configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
    <!-- 
                设置 compilation debug="true" 可将调试符号插入
                已编译的页面中。但由于这会 
                影响性能,因此只在开发过程中将此值 
                设置为 true。
            -->
    <compilation debug="true" targetFramework="4.0">
    <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
    <!--
                通过 <authentication> 节可以配置 ASP.NET 用来 
                识别进入用户的
                安全身份验证模式。 
            -->
    <authentication mode="Windows"/>
    <!--
                如果在执行请求的过程中出现未处理的错误,
                则通过 <customErrors> 节可以配置相应的处理步骤。具体说来,
                开发人员通过该节可以配置
                要显示的 html 错误页
                以代替错误堆栈跟踪。        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    </configuration>
      

  2.   

    SQLHelper.cs文件private static readonly string strConnection = @"server=.\sqlexpress;database=school;Persist Security Info=True;uid=sa;pwd=sa"; 改成  server=.;database=school;Security Integrated Security=True; 然后整个解决方案重新编译下在启动 如果你school附加在express的数据库上 server=.\sqlexpress