CFRONT proxy component for .NET usage v1.2

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2006-02-03 in Download section
CFRONT proxy component for .NET usage v1.2
This ActiveX component helps to use CFRONT OCX within Microsoft Visual Studio .NET (removed all possible 'Variant' usages).

http://www.mibuso.com/dlinfo.asp?FileID=270

Discuss this download here.

Comments

  • AnonymousAnonymous Guest Posts: 137
    This code doesn't make sense:
    Public Sub AssignField_AsText( _
        ByVal hTable As Long, ByVal hRec As Long, _
        ByVal FieldName As String, ByVal FieldValue As String)
    
      Dim lValue As Variant
    
      CF.AssignField    hTable, hRec, CF.FieldNo(hTable, FieldName), lValue
    
    End Sub
    
    How and when is the FieldValue stored into the lvalue-field before being passed as last parameted to AssignField?
  • AnonymousAnonymous Guest Posts: 137
    hmmm... i am stupid fool! sorry...
    I forgot insert one small line of code because i am not using this "Assign" procedures.

    Working code must be:
    Public Sub AssignField_AsText( _
        ByVal hTable As Long, ByVal hRec As Long, _
        ByVal FieldName As String, ByVal FieldValue As String)
    
      Dim lValue As Variant
      lValue = FieldValue
      CF.AssignField    hTable, hRec, CF.FieldNo(hTable, FieldName), lValue
    
    End Sub
    
  • timjadtimjad Member Posts: 5
    Hi!

    I'm getting the following message... any ideas?

    Error Message:
    You do not have permission to run the C/Front System

    Thanks,
    Tim
  • hansdegraafhansdegraaf Member Posts: 9
    What is the differnce between the default OCX and this .NET component?

    Regards,

    Hans de Graaf
  • hansdegraafhansdegraaf Member Posts: 9
    I'm getting this error when trying to connect to the database.
    Object variable or With block variable not set
  • Tazzy1972Tazzy1972 Member Posts: 18
    Hi All

    I am using this to code in C#. I am trying to update Navision database from a c# application running on the .net framework.

    My c# codes are:

    cf1.InitializeCFRONT();
    cf1.ConnectServerAndOpenDatabase("NDBCN", "testdb", "tcp", "C:\\DP Tech\\Projects\\Developement\\Testing DB.fdb", 10000, true, false, "sa", "sa");
    cf1.OpenCompany("Testing");
    tab18 = cf1.OpenTableByID(18);
    rec18 = cf1.AllocRec(tab18);
    temp1 = cf1.FindRec(tab18, rec18, "+");
    cf1.SetFilter(tab18, "No.", "= A-10000");
    cf1.AllowRecordNotFound();
    cf1.SetStopOnAllExceptions(false);
    if (cf1.FindRec(tab18, rec18, "-").ToString() == "True")
    {
    //Modify Customer Data
    MessageBox.Show("Found");
    }
    else
    {
    //Add Customer Data
    MessageBox.Show("Not Found");
    cf1.InitRec(tab18, rec18);
    cf1.AssignField_AsText(tab18, rec18, "No.", "A-10000");
    cf1.AssignField_AsText(tab18, rec18, "Name", "Testing");
    cf1.InsertRec(tab18, rec18);
    }

    And the error I got was something about cannot make changes in the database using this trigger.

    Has anyone done this before? And what seems to be the problem?

    Thanks

    Lawrence
  • hansdegraafhansdegraaf Member Posts: 9
    Hello,

    If I'm doing this function:
    string fieldvalue = cf.GetFieldDataByName(hTable,hRecord,columnname).ToString();

    I'm getting the error {"Object reference not set to an instance of an object." }.

    This is only on Date fields.


    Regards,

    Hans
  • lavakumarlavakumar Member Posts: 21
    Sir

    I am also trying to use CFRONT in C#.net

    Can any one tell me what data structure is to be used for hTable and hRec in C# for Corrosponding DBL_HTABLE and DBL_HREC in C/FRONT library.


    Thank you very much

    Kumar
  • SuddenSudden Member Posts: 3
    I downloaded this added it to my project as an reference and it worked great.

    After some time the reference dissapered/did not work and i can no longer add it to my project.

    Any help?
  • bramantebramante Member Posts: 11
    I'm having a problem in attempting to insert a record into a Navision .FDB database table using Visual Studio.NET and C#. When I try to insert a record using the CFRONT.dll AssignField() function, I get a "'type mismatch' error from mscorlib.dll".

    Some people recommend using long instead of int, but CFRONTClass.AssignField only takes int as inputs. When I try it I get the following error message: "The best overloaded method match for 'CFRONTLib.CFRONTClass.AssignField(int, int, int, ref object)' has some invalid arguments"

    Others have recommended CFRONT proxy component for .NET usage v1.2 which I have also tried. Using Interop.netCFRONT2_Prj supposedly allows for 'AssignField_AsText', ..Boolean, ..Date, ..Decimal,..Integer, and ..Time.

    This will not even allow me to connect to a server or a database.
    When I try I get the error message: "Object variable or With block variable not set". I'm setting the object variable the same way that I set the object variable for CFRONTClass using Interop.CFRONTLib

    I've noticed many other similar un-answered posts. I'm hoping someone has the expertise and can reply with meaningful specifics.
  • PoweRoyPoweRoy Member Posts: 43
    Tazzy1972 wrote:
    Hi All
    <>

    My c# codes are:

    cf1.InitializeCFRONT();
    cf1.ConnectServerAndOpenDatabase("NDBCN", "testdb", "tcp", "C:\\DP Tech\\Projects\\Developement\\Testing DB.fdb", 10000, true, false, "sa", "sa");
    cf1.OpenCompany("Testing");
    tab18 = cf1.OpenTableByID(18);
    rec18 = cf1.AllocRec(tab18);
    temp1 = cf1.FindRec(tab18, rec18, "+");
    cf1.SetFilter(tab18, "No.", "= A-10000");
    cf1.AllowRecordNotFound();
    cf1.SetStopOnAllExceptions(false);
    if (cf1.FindRec(tab18, rec18, "-").ToString() == "True")
    {
    //Modify Customer Data
    MessageBox.Show("Found");
    }
    else
    {
    //Add Customer Data
    MessageBox.Show("Not Found");
    cf1.InitRec(tab18, rec18);
    cf1.AssignField_AsText(tab18, rec18, "No.", "A-10000");
    cf1.AssignField_AsText(tab18, rec18, "Name", "Testing");
    cf1.InsertRec(tab18, rec18);
    }

    <>

    i am trying to get this working in c# to start. i included the reference at TopicStart now i am trying to use it.
    How do i declare cf1 (used above) ?
Sign In or Register to comment.