数据库问题!
下面有一段代码,老是出错,看来看去也不知道哪儿错了.请那位高人帮忙指点下
SqlConnection con = new SqlConnection ( "server=3011-0F50B4AD92;database=login;uid=sa;pwd=; ");
SqlCommand cmd=new SqlCommand( "select * from T_USER_KQ ",con);
SqlDataAdapter myDataAdapter =new SqlDataAdapter();
DataSet myDataSet =new DataSet( "T_USER_KQ ");
myDataAdapter.SelectCommand=cmd;
SqlCommandBuilder xx = new SqlCommandBuilder(myDataAdapter);
con.Open();
myDataAdapter.Fill(myDataSet);
con.Close();
[解决办法]
SqlConnection con = new SqlConnection ( "server=3011-0F50B4AD92;database=login;uid=sa;pwd=; ");
---------------
SqlConnection con = new SqlConnection ( "server=.;database=login;uid=sa;pwd=; ");
[解决办法]
设置断点跟踪一下看看。再把try catch加上
[解决办法]
报的什么错..
[解决办法]
加
try
catch
把错误信息贴出来