i’m using a code to send the ConnectionInfo to the crystalReportViewer
private void button1_Click(object sender, EventArgs e)
{
ConnectionInfo myConnectionInfo = new ConnectionInfo();
myConnectionInfo.ServerName = "192.168.3.58";
myConnectionInfo.DatabaseName = "SHRK-Traffic";
myConnectionInfo.UserID = "sa";
myConnectionInfo.Password = "pass";
setDBLOGONforREPORT(myConnectionInfo);
crystalReportViewer1.Visible = true;
}
private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
{
TableLogOnInfos mytableloginfos = new TableLogOnInfos();
mytableloginfos = crystalReportViewer1.LogOnInfo;
foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
{
myTableLogOnInfo.ConnectionInfo = myconnectioninfo;
}
}
i’m working with this code in web app and it’s working fine..but in windows app it show that error
i’m getting an error

You need to create a TableLogOnInfo object, then set it’s ConnectionInfo object to the correct information i.e.:
Then go ahead and add that configured TableLogOnInfo object to your LogOnInfo collection: