Skip to Content
author's profile photo Former Member
Former Member

Converting from vb.net to c# issues

I converted the vb.net code to c# but am getting wrong records in the database table when converted to c# but in vb.net the same code is working fine. Please I need help in the image attached the code in master is not the same as rows

VB.NET CODE

If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Then

If pVal.ItemUID = "MatrixI" And pVal.ColUID = "CDes" Then

oCDes = CType(oMatrixI.Columns.Item(1).Cells.Item(pVal.Row).Specific, SAPbouiCOM.EditText)

If oCDes.Value <> "" Then

oCDes = CType(oMatrixI.Columns.Item(1).Cells.Item(oMatrixI.RowCount).Specific, SAPbouiCOM.EditText)

If oCDes.Value <> "" Then

oForm.Freeze(True)

SBO_Application.Forms.Item("FrmG").DataSources.DBDataSources.Item("@GP_DL").Clear()

oMatrixI.AddRow()

For i As Integer = 1 To oMatrixI.RowCount

oMatrixI.Columns.Item(0).Cells.Item(i).Specific.Value = i

Next

oForm.Freeze(False)

End If

End If

End If

C# CODE

if (pVal.ItemUID == "MatrixI" & pVal.ColUID == "CDes") {

oCDes = ((SAPbouiCOM.EditText)(oMatrixI.Columns.Item(1).Cells.Item(pVal.Row).Specific)));

if (oCDes.Value != "") {

oCDes = ((SAPbouiCOM.EditText)(oMatrixI.Columns.Item(1).Cells.Item(oMatrixI.RowCount).Specific));

if (oCDes.Value != "") {

oForm.Freeze(true);

SBO_Application.Forms.Item("FrmG").DataSources.DBDataSources.Item("@GP_DL").Clear();

oMatrixI.AddRow();

for (int i = 1; i <= oMatrixI.RowCount; i++) {

SAPbouiCOM.EditText rowID = ((SAPbouiCOM.EditText)(oMatrixI.Columns.Item(0).Cells.Item(i).Specific));

rowID.String = i.ToString();

}

oForm.Freeze(false);

}

}

}

DATABASE RESULT

db.PNG (8.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 28, 2016 at 01:37 PM

    If you look at the description at the top of this space, you'll find that it's specifically for the .NET SDK that comes with SAP BusinessObjects. So, I think you've posted in the wrong space.

    -Dell

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.