on 03-14-2014 4:34 PM
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!
sorry for the way I posted the question. I'm trying to modify it. seems not to work!!!
my first time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.