Sir
I have already added these Lines, but still error is there
my code is
Private Sub printform2()
Dim connectionString, sql As String
Dim connection As SqlConnection
Dim reportdocument As New ReportDocument()
reportdocument.Load(Server.MapPath("form2.rpt"))
Using dsdeo As New dutylist()
connectionString = ConfigurationManager.ConnectionStrings("accountsConnectionString").ToString
connection = New SqlConnection(connectionString)
' Using con As New SqlConnection("Data Source=SureshDasari;Integrated Security=true;Initial Catalog=MySampleDB")
connection.Open()
'Dim cmd As New SqlCommand
sql = "select a.centcode,a.name,a.duty,a.dutydays,b.centname as centname,b.students as students from centduty24 a left join centmast24 b on a.centcode=b.centcode where a.centcode=" & lblcentcode.Text & ""
Using cmd As New SqlCommand(sql, connection)
''("select a.centcode,a.name,a.duty,a.dutydays,b.centname as centname,b.students as students from centduty24 a left join centmast24 b on a.centcode=b.centcode where a.centcode=" & lblcentcode.Text & "", connection)
Using da As New SqlDataAdapter(cmd)
da.Fill(dsdeo, "centduty24")
connection.Close()
'End Using
Using examreport As New ReportDocument()
examreport.Load(Server.MapPath("form2.rpt"))
examreport.SetDataSource(dsdeo.Tables("centduty24"))
examreport.SetDataSource(dsdeo)
examreport.ExportToHttpResponse(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, Response, True, "form2")
examreport.Close()
examreport.Dispose()
GC.Collect()
End Using
End Using
End Using
End Using
End Sub
Sir, Pl examine the code and guide
Pl also advice how to get the file signed with DSC before downloading