on 08-21-2022 12:31 PM
Hello,
I need to fill a Matrix with the result of a RecordSet.
Why I do not use a Grid? because the user must be able to add new lines and enter new Data to the result.
What is the best way to do that in case the result of my Recordset are Fields with different types like Date,Price,long Text and whatsoever.
Because this kind of fill a matrix with a Recordset gives always an ErrorMessage that the Field Date and Price is not an Edittext :
SAPbobsCOM.Recordset rset = (SAPbobsCOM.Recordset)Program.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
String query = @"SELECT T0.[U_Remark],
T0.[U_InvoiceNr],
T0.[U_InvoiceDate],
T0.[U_InvoicePrice]
FROM [dbo].[@MEMO_PCDETAILS] T0
WHERE T0.[U_RequestNr] = '" + code + "'";
rset.DoQuery(query);
rset.MoveFirst();
for (int i = 0; i < rset.RecordCount; i++)
{
Matrix1.AddRow();
((SAPbouiCOM.EditText)Matrix1.Columns.Item("Rem").Cells.Item(i + 1).Specific).Value = rset.Fields.Item(0).Value.ToString();
((SAPbouiCOM.EditText)Matrix1.Columns.Item("InNu").Cells.Item(i + 1).Specific).Value = rset.Fields.Item(1).Value.ToString();
((SAPbouiCOM.EditText)Matrix1.Columns.Item("InDate").Cells.Item(i + 1).Specific).Value = rset.Fields.Item(2).Value.ToString();
((SAPbouiCOM.EditText)Matrix1.Columns.Item("InPr").Cells.Item(i + 1).Specific).Value = rset.Fields.Item(3).Value.ToString();
rset.MoveNext();
}<br>
User | Count |
---|---|
94 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.