前台代码如下:
System.Data.ConnectionState state = new ConnectionState();
if (state == System.Data.ConnectionState.Closed)
{
using (TestProcDataClassesDataContext dc = new TestProcDataClassesDataContext())
{
radGridView1.DataSource = dc.MaterialInfos;//此处出现异常:用户’test'登录失败
}
}
Settings.Designer.cs中字符串如下:
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=127.0.0.1;Initial Catalog=test;User ID=test;Password=test")]
public string testConnectionString {
get {
return ((string)(this["testConnectionString"]));
}
}
同样问题本人在http://topic.csdn.net/u/20120810/16/b3a6c86b-7343-43c9-a1fd-7c54c605ec9e.html
进行了提问,若帮助解决问题可得双倍分。
------解决方案--------------------
用vs把表托进去的时候,有个提示,您点击那个是即可。