cancel
Showing results for 
Search instead for 
Did you mean: 

Display All BP info in a Gridview

Former Member
0 Kudos

Hello Experts first time with SAP B1. I managed to connect to SAP B1 database using C# and SAP DI API version 9.00 and display ONE BP info. what I want to do is display all BPs or one BP info. in a GridView. This is my code to connect which works perfect: SAPbobsCOM.Company vCmp = new SAPbobsCOM.Company(); int lRetCode, lErrCode; string sErrMsg; vCmp.Server = "SAPR01"; vCmp.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008; vCmp.CompanyDB = "company"; vCmp.UserName = "user"; vCmp.Password = "*****"; vCmp.language = SAPbobsCOM.BoSuppLangs.ln_English; lRetCode = vCmp.Connect(); if (lRetCode == 0) {     label1.Text = "Hello World!"; } else {     label1.Text = "Connection Failed!"; } lErrCode = vCmp.GetLastErrorCode(); sErrMsg = vCmp.GetLastErrorDescription(); vCmp.GetLastError(out lErrCode, out sErrMsg);  and this is my code to display BP's Name using a label: SAPbobsCOM.BusinessPartners BP; BP = vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners); string  cardName; if (BP.GetByKey("C70000")) {     cardName = BP.CardName;     label1.Text = cardName; } what i couldn't figure out is displaying all BPs/one BP info in a Gridview. in other words how to bind to a Gridview? thank you!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

sorry for the way I posted the question. I'm trying to modify it. seems not to work!!!

my first time