CloudApps
asked on
Run a Insert...Select statement from a Web page.
I have a web page that launches a Crystal Report. The report prints mailing labels for expiration notices that are being sent out.
I need to append records to an event history table in the database for the expiration notices.
Here is the Visual Basic code for the button that launches the labels:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --
Protected Sub Button_Preview_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_Preview.Click
If (Session("report") Is Nothing) Then
Dim rd As New ReportDocument
rd.Load(Server.MapPath("Ex pirationNo ticesMaili ngLabels.r pt"))
Dim boConnectionInfo As CrystalDecisions.Shared.IC onnectionI nfo
For Each boConnectionInfo In rd.DataSourceConnections
boConnectionInfo.SetLogon( "UserName" , "Password")
Next
Session.Add("report", rd)
CrystalReportViewer1.Repor tSource = Session("Report")
rd.SetParameterValue("Mont hs To Expiration", Me.MonthsToExpiration.Sele ctedValue)
End If
End Sub
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
Please point me in the right direction for executing my Insert...Select statement.
Thanks,
I need to append records to an event history table in the database for the expiration notices.
Here is the Visual Basic code for the button that launches the labels:
--------------------------
Protected Sub Button_Preview_Click(ByVal
If (Session("report") Is Nothing) Then
Dim rd As New ReportDocument
rd.Load(Server.MapPath("Ex
Dim boConnectionInfo As CrystalDecisions.Shared.IC
For Each boConnectionInfo In rd.DataSourceConnections
boConnectionInfo.SetLogon(
Next
Session.Add("report", rd)
CrystalReportViewer1.Repor
rd.SetParameterValue("Mont
End If
End Sub
--------------------------
Please point me in the right direction for executing my Insert...Select statement.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was refering to an INSERT INTO with a SELECT statement instead of a VALUE statement.
After some additional research, I have created a Stored Procedure to be executed.
Thanks for the help.