Hi, I tried the above and error message shown as below:
[Time] = 22/10/2008 15:06:50
[Function] = ExecuteNestedGroup
[Message] = Object reference not set to an instance of an object.
[Source] = Syncfusion.DocIO.Base
[StackTrace] = at Syncfusion.DocIO.DLS.MailMerge.ExecuteNestedGroup(DbConnection conn, ArrayList commands)
at sysUDFRun.btnRun_Click(Object sender, EventArgs e) in C:\DotNetProjs\MysysEss\uiHRMS\sysUDFRun.aspx.vb:line 118
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
My codes:
Dim constr As String = Me.GetConfigurationKey("databases", "mysyshr\Connection")
constr = "provider=SQLOLEDB;server=(local);uid=sa;pwd=123456;database=demohrms;"
tablenm = Me.osysMailM.Entity.ctablemailm
sqlStmt = RTrim(Me.osysMailM.Entity.csqlstmt)
Dim conn As OleDbConnection = New OleDbConnection(constr)
conn.Open()
Dim commands As ArrayList = New ArrayList()
Me.osysMailM.LoadRow(Me.osysUDFMM.Entity.sysMailM1_fk)
tablenm = Me.osysMailM.Entity.ctablemailm
sqlStmt = RTrim(Me.osysMailM.Entity.csqlstmt)
Dim entry As DictionaryEntry = New DictionaryEntry(tablenm, sqlStmt)
commands.Add(entry)
If Me.osysUDFMM.Entity.sysMailM2_fk > 0 Then
Me.osysMailM.LoadRow(Me.osysUDFMM.Entity.sysMailM2_fk)
tablenm = Me.osysMailM.Entity.ctablemailm
sqlStmt = RTrim(Me.osysMailM.Entity.csqlstmt)
sqlStmt = "SELECT dbo.dateonly(dattdt,'UK') AS AttnDate,catttm1 AS InTime,iattminlate AS LIMin " & _
"FROM axdyattn WHERE cattnoee=%Employee.EmployeeNo%'"
entry = New DictionaryEntry(tablenm, sqlStmt)
commands.Add(entry)
End If
document.MailMerge.ExecuteNestedGroup(conn, commands)