u can try like that this is c# button code but i do not think there would be so much difference between c# and vb code .
// firstly add namespace
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Shared;
protected void btnPrint_Click(object sender, EventArgs e)
{
ReportDocument rptDoc = new ReportDocument();
rptDoc.Load(Server.MapPath("../RPT/crstSubReport.rpt"));
CrystalDecisions.Shared.TableLogOnInfo loginfo;
foreach (CrystalDecisions.CrystalReports.Engine.Table myTable in rptDoc.Database.Tables)
{
loginfo = myTable.LogOnInfo;
loginfo.ConnectionInfo.ServerName = @"";
loginfo.ConnectionInfo.DatabaseName = "";
loginfo.ConnectionInfo.UserID = "";
loginfo.ConnectionInfo.Password = "";
myTable.ApplyLogOnInfo(loginfo);
}
MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(stream.ToArray());
rptDoc.Refresh();
}