F
flyskylf
Unregistered / Unconfirmed
GUEST, unregistred user!
我的设计思路是这样的
public Form1()
{
InitializeComponent();
string strConn = "workstation id=DNSSERVER;packet size=4096;user id=sa;password =123456;data source=MS-D1D2448C438F;persist security info=False;initial catalog=PTdb";
MyDataset myset = new MyDataset();
SqlConnection sqlcnn = new SqlConnection(strConn);
SqlDataAdapter myadapter = new SqlDataAdapter();
string sqlstr = "select * from results";
myadapter.SelectCommand = new SqlCommand(sqlstr,sqlcnn);
//将从数据库中的Results表中选出得所有数据放在myset中
myadapter.Fill(myset,"results");
//显示报表
MyCrystalReport myrpt = new MyCrystalReport();
//设置报表数据源
crystalReportViewer_Report.ReportSource = myrpt;
}
调试也通过了,也运行了,它出现了一个DataBase登录对话框
点击ServerName的下拉框也没有要选的东西,是一个空的
我输进去点击Finish提示登录失败
请问各位大侠是怎么回事,怎么解决
谢谢!!
图片在
http://images.blogcn.com/2005/11/26/9/ventry,2005112617404.jpg
public Form1()
{
InitializeComponent();
string strConn = "workstation id=DNSSERVER;packet size=4096;user id=sa;password =123456;data source=MS-D1D2448C438F;persist security info=False;initial catalog=PTdb";
MyDataset myset = new MyDataset();
SqlConnection sqlcnn = new SqlConnection(strConn);
SqlDataAdapter myadapter = new SqlDataAdapter();
string sqlstr = "select * from results";
myadapter.SelectCommand = new SqlCommand(sqlstr,sqlcnn);
//将从数据库中的Results表中选出得所有数据放在myset中
myadapter.Fill(myset,"results");
//显示报表
MyCrystalReport myrpt = new MyCrystalReport();
//设置报表数据源
crystalReportViewer_Report.ReportSource = myrpt;
}
调试也通过了,也运行了,它出现了一个DataBase登录对话框
点击ServerName的下拉框也没有要选的东西,是一个空的
我输进去点击Finish提示登录失败
请问各位大侠是怎么回事,怎么解决
谢谢!!
图片在
http://images.blogcn.com/2005/11/26/9/ventry,2005112617404.jpg