ds是自己新建的xsd的数据集
da是OleDbDataAdapter
cmm是OleDbCommand将数据绑定到水晶报表的代码如下:ds = new dsT();

con.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;pwd=sa;Initial Catalog=pubs;Data Source=LAB4";
cmm = new System.Data.OleDb.OleDbCommand();
cmm.Connection = con;
cmm.CommandType = CommandType.Text;
cmm.CommandText = "select fname,lname from employee where emp_id = 'A-C71970F'";
da.SelectCommand=cmm;
da.Fill(ds);CrystalReport1 crt = new CrystalReport1();
crt.SetDataSource(ds.Tables[0]);
this.crystalReportViewer1.ReportSource = crt;
现在的问题是:
每次进入到水晶报表的时候,都要进行一次数据库的登陆,
报表显示的数据无错误,但是,怎样才能避免在程序里面使用报表时不用进行数据库登陆呢?