C/FRONT and C#

Hi!, I am trying to develop an object in c# that uses c/front dll. Most of the function calls works just fine but something else doesn’t return the espected result… like when I am trying to retrieve all FeildNames from a table … some of them get read and others not at all. Does anybody have any suggestion? I can send some sample code. ciao

Hi, Go ahead and send me the sample code - or the entire zipped Visual Studio .NET project preferrably. I’m interested in looking at it. Can you send zipped files via the private message facility?

Hi, Might be it’s not showing some fields which are having space and some special characters which is not supported by C#.Please check this.

Here is the problem… Each Navision Company has a set of tables and one of them is for example… “Languages” and another is “Payment Conditions”. Using a for loop as showed below I retrieve the FieldNumber of the table. I can esily read all of the field numbers but when I try to retrieve the string of the FieldName associated to it I am not able to retireve all of them… For instance in the case of table #3 “Payments Conditions”, there are 2 enabled fields. I retrieve all of them (total of 2). With the table “Languages”, I have a compleatly different situations… I have only two fields… both enabled but I cannot retrieve their names. Also… if I go back to “Payments condition” table, I enable all of the fields (tot of 7) only 3 of them get reads the other ones cannot be accessed. Also I need to help to find out how to map the error code in cf.h like : #define DEFINE_DBERR(xErrNo) ((((DBL_S32)(Module_DB) * 0x10000L + (DBL_S32)(xErrNo)) | 0x1000000L) | 0x4000000L) #define DBL_Err_TableNotFound DEFINE_DBERR(1008) to be used with c#. The loop in my code is: for(; 0 != ( fldNo = dllWrap.DBL_NextField(TabHandle, fldNo)):wink: { try { fldName = dllWrap.DBL_FieldName(TabHandle, fldNo); objDS.Tables[“infoTabella”].Columns.Add(new DataColumn(fldName, typeof(string))); } catch(Exception err) { MessageBox.Show("error on field name retrieve: "+err.Message); errorFields++; } }

quote:


Originally posted by Rajeshj: Hi, Might be it’s not showing some fields which are having space and some special characters which is not supported by C#.Please check this.


Thanks Rajeshj… I modified the field names removing spaces and special characters like accented letter of italian words but it still does not work.

Thanks to everybody… I was able to solve most of the problem…

I created a .NET library for using C/FRONT. See topic http://www.navision.net/forum/topic.asp?TOPIC_ID=4441 regards, Peter Nagel