Free Support Forum - aspose.com

Tables: ExecuteWithRegions

I have this code:

Dim msqlWerkdagen As String = “SELECT werkdag.*, periode.p_naam, periode.id AS p_id, Format([w_dag],‘dddd dd/mm/yyyy’) AS w_Dag1 FROM periode LEFT JOIN werkdag ON periode.id = werkdag.w_periodeID”
If ds.Tables.Contains(“werkdagDetail”) = True Then ds.Tables(“werkdagDetail”).Clear()
Dim da As New OleDb.OleDbDataAdapter(msqlWerkdagen & " where periode.id =" & drv(“s_periode”).ToString & " order by w_dag", clsAlg.conn)
da.Fill(ds, “WerkdagDetail”)
rijdoc.MailMerge.ExecuteWithRegions(ds.Tables(“WerkdagDetail”))

And in my document i have

?TableStart:WerkdagDetail?

Nr<o:p></o:p>

datum<o:p></o:p>

?p_id?<o:p></o:p>

?w_Dag1?<o:p></o:p>

?TableEnd:WerkdagDetail?

Why the table doesn’t change when i run the code?

thx

Stijn

<o:p></o:p>



Hi,

Thank you for considering Aspose.

Please debug your code and check if DataTable that you pass to ExecuteWithRegions contain columns named “p_id” and “w_Dag1” and it is not empty.

DmitryV,

Thx for your reponse. As you see in my sql command, the columns are in de dataTable. I check it again and for one example that not work, i have 16 rows. w_Dag1 and p_id are required fields so that cann’t be the problem.

Other mergefields that i fill with execute works file. So i think it’s something about the document. Any idea?

thx

Stijn

Please attach the document. This will allow us to provide an exact answer.

problem solved, there was something wrong with the sections