Hello
I want to have a Sql Server CLR, written in VB. I want to run Aspose.Word in the CLR. I want to run a aspx web page that will call a CLR, which in turn will generate a Aspose.Word mail merge document that can saved on a server.
I did not see any examples so I am wondering if this can be done. Any assistents would be helpful.
My CLR looks like
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Partial Public Class StoredProcedures
Public Shared Sub CF_LIST_ANNUITY_LOYALTY_TRACKING_CLR_SP()
Try
Dim sqlConnection As SqlConnection = New SqlConnection("context connection=true")
Dim lt As New loyalityTracking
Dim createDateTime As DateTime
Dim createDateTimeStr As String
Dim _dt As New DataTable
Dim _cmd As New SqlCommand
Dim _adpt As New SqlDataAdapter
Dim errorOccurred As Boolean = False
Dim errorMessage As String = ""
sqlConnection.Open()
createDateTimeStr = "06/22/2010"
createDateTime = CDate(createDateTimeStr)
_dt = lt.CF_STMT_BILLING_VANISH_LTR_GENERATE_PASS_LETTERS_SP(sqlConnection, createDateTime, errorOccurred, errorMessage)
If errorOccurred <> True Then
'Aspose.Word for generating document from _dt
End If
Catch ex As Exception
End Try
End Sub
Public Class loyalityTracking
Public Function CF_STMT_BILLING_VANISH_LTR_GENERATE_PASS_LETTERS_SP(ByVal sqlConnection As SqlConnection, ByVal createDateTime As DateTime, ByRef errorOccurred As Boolean, ByRef errorMessage As String) As DataTable
Dim _dt As New DataTable
Dim _cmd As New SqlCommand
Dim _adpt As New SqlDataAdapter
errorOccurred = False
_cmd = New SqlCommand("CF_STMT_BILLING_VANISH_LTR_GENERATE_PASS_LETTERS_SP", sqlConnection)
_cmd.CommandType = CommandType.StoredProcedure
_cmd.Parameters.AddWithValue("@PROCESS_DATE", createDateTime)
_cmd.CommandTimeout = 0
Try
_adpt = New SqlDataAdapter
_adpt.SelectCommand = _cmd
_adpt.Fill(_dt)
Catch ex As Exception
errorOccurred = True
errorMessage = ex.Message
End Try
Return _dt
End Function
End Class
End Class
Thanks
Kevin