cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert the recordset to datatable

Former Member
0 Kudos

i given a sample code here...

tempcoa = ((SAPbobsCOM.BusinessPartners)(tempcomp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)));

temprecset = ((SAPbobsCOM.Recordset)(tempcomp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)));

temprecset.DoQuery("select CardCode,CardName from OCRD where CardType ='S'");

tempcoa.Browser.Recordset = temprecset;

this tempreset is a recordset ..

i want to convert this to be datatable?

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

Hi,

look at this [Link|;

there you see how to load a matrix with a datatable.

it's no big deal - place your recordset in .DoQuery

and bind the columns

lg David

Former Member
0 Kudos

Hi, David Nussböck

we solved through XML.

Reagds,

Sampath Kumar Devunuri.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try this..

OForm= sbo_application.Forms.Item("FormUid")

OForm.DataSources.DataTables.Add("Data")

OForm.DataSources.DataTables.Item("Data").ExecuteQuery("select CardCode,CardName from OCRD where CardType ='S'")

if you want to bind the values with matrix means, then

OMatrix=OForm.Items.Item("MatrixUid").Specific

OMatrix.Columns.Item("colid").DataBind.Bind("Data", "CardCode")

OMatrix.Columns.Item("Colid").DataBind.Bind("Data", "CardName")

OMatrix.Clear()

OMatrix.LoadFromDataSource()

OMatrix.AutoResizeColumns()

Regards,

Ganesh k