I am using crystal report (procedure bind) which is not releasing connection when I exit from report.
I am passing parameter to crystal as :
Dim InserSql = "exec USP_TEST parameter1,parameter2
ConnectDB() /* connecting to database */
DtAdapter = New OdbcDataAdapter(InserSql, Con)
DtAdapter.Fill(DataTable)
rpt.SetDataSource(DataTable)
rpt.SetDatabaseLogon("usrname", "password")
CrystalReportViewer1.ReportSource = rpt /* rpt is crystal report object */
Con.Close() /*closing connection */
rpt.Database.Dispose()
Con.Dispose()
Which closes connection in UI but not releasing connection of crystal report.
Please help.
You are logging on to the server with the report but setting the report’s datasource to a datatable pulled with the dataadapter. Once the datatable is populated and connection disposed you are no longer connected to the sql server as you are working with a dataset in memory. Instead of setting logon credentials for the report clear the datasource connections and set the datasource to the datatable in memory.