//dll loader [DllImport("cfront.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int DBL_GetFieldData(string dst, int dstsize, int hTable, int record, int fieldnr); //the parser case "lr" : //list records int record = DBL_AllocRec(htable); DBL_InitRec(htable, record); string s = "temp string"; if (DBL_FindRec(htable, record ,"-") ) { int j = DBL_GetFieldData(s,100,htable, record,1); Console.WriteLine(Convert.ToString(j) + s); Console.WriteLine("findrec succes"); } else result.Add("No records found"); DBL_FreeRec(record); break;
//the dll loading [DllImport("cfront.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int DBL_GetFieldData(char[]dst, int dstsize, int hTable, int record, int fieldnr); //the parser case "lr" : //list records int record = DBL_AllocRec(htable); DBL_InitRec(htable, record); char[] s = new char[100]; if (DBL_FindRec(htable, record ,"-") ) { int j = DBL_GetFieldData(s,100,htable, record,1); Console.WriteLine(Convert.ToString(j)); string temp = ""; for (int k = 0 ; k < 100 ; k++) { temp = temp + s[k]; } Console.WriteLine(temp); Console.WriteLine("findrec succes"); } else result.Add("No records found"); DBL_FreeRec(record); break;
Comments
Noone knows a sollution?
meanwhile i tried to start another project and try to connect with odbc only the .open isnt working :P suspect the connection string, but whats the valid one for navision?..
but it gives a "An unhandled exception of type 'System.NullReferenceException' occurred in csharptest.exe
Additional information: Object reference not set to an instance of an object" error
are there any other solutions?
is there another way to make the .h file usefull in c#?