我创建了一个特别简单的数据库,然后在vs里创建web程序想要用网页的形式进行连接数据库,我那个在设计窗口的时候连接数据库的代码该怎么写啊,老错
通常不都是在web.config里<connectionStrings>直接写连接字符串么?
<connectionStrings> <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-FeedBack-20160817012924.mdf;Initial Catalog=aspnet-FeedBack-20160817012924;Integrated Security=True" providerName="System.Data.SqlClient" /> <add name="SqlConnection" connectionString="Data Source=localhost;Initial Catalog=FeedBack;User ID=sa;Password=Welcome123;Integrated Security=false;Connect Timeout=30" providerName="System.Data.SqlClient"/> </connectionStrings>