Hello again.

I made a sample that almmost the same as You do, and it works as expected.
I create a Axapta2 object the first time that it is needed and I set
the reference to null in Form_Closed.

Before each request (I execute a query), I Logon(...) and efter that,
I Logoff().

In Axapta (Admin->Online users), my user does not show up.

I can also change the code to create and release the Axapta2 object
before/after each update with the same result.

Can You debug Your code to find out on which row that Your application
crashes?
I think that You have a problem with mismatching Login/Logoff (it
shouldn't cause a crash anyway). Coul You add Console.WriteLine(...)
statements in Your code and debug and watch the output window to find
out if this is the case?

/Andreas


--- In [email protected], "Cenk Ince" <[EMAIL PROTECTED]> wrote:
> Hi Andreas
>
> 1. Error Message  :  Buffer overrun detected! Program …
Application5\bin\Debug\WindowsApplication5.exe
> A buffer overrun has been detected which has corrupted the programs
internal state. The program cannot safely continue execution and must
now be terminated.
>
> 2. I use just one of them, problem is when I login in click of
button, second time I click button I get error above.
>
> 3. Again I use comment one of them to logoff.
>
> 4. I can logon and log of because if I don't logon in button click,
it works very vell.
>
> Thanks
>
> Cenk İnce
>
> -----Original Message-----
> From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of
andreas_paulsson_cimkey_se
> Sent: 16 Mayıs 2005 Pazartesi 12:12
> To: [email protected]
> Subject: [development-axapta] Re: Axapta2 interface logon and
logoff.[Urgent]
>
> A few questions for You:
>
> 1. Can you write the text of the error message here instead? I think
> that You attached an image that Yahoo removed, so we cannot see the
> error message.
>
> 2. What is the purpose of the login in the Form_Load? Since You login
> again in the button1_Click method, You try to logon when You are
> already logged on.
>
> 3. And button2_Click? This would only be valid if You never clicked
> button1, since You logoff when processing has completed in
> button1_Click.
>
> 4. Besides, use try/catch blocks to make sure that You logon/logoff
> properly (which also means moving the login in button1_Click into the
> Axapta_Gonder method):
>
> axapta.Logon(...)
> Try  
>
>    ' Do your processing.
> Catch e as ClassLoadException  
>    ' Perform error handling.
> Finally  
>    ' "Finally" block that is always run.
>    axapta.Logoff()
> End Try
>
> Note that the code above may not be syntactically correct since I
> usually use C#.
>
> /Andreas
>
> --- In [email protected], "Cenk Ince" <[EMAIL PROTECTED]>
> wrote:
> > Hi all;
> >
> > 
> >
> > We have a program (C#) that uses Axapta2 interface and inserts a
> record in table "UrunRecetesiOnay".
> >
> > When we logon to axapta and log off for every button click we get
> error (Picture below).
> >
> > If we logon on formload and log off on formunload there is no error,
> but it uses one of my license users permanently.
> >
> > 
> >
> > Why can this happen, what can i do?
> >
> > 
> >
> > Thanks.
> >
> > 
> >
> > 
> >
> > 
> >
> >             private void Form1_Load(object sender, System.EventArgs
> e)
> >
> >             {
> >
> >                axapta = new Axapta2();
> >
> >              
> axapta.Logon2("datasistem","aaaabbbb","spk","","SPARK","","",0,0,0);
> >
> >             }
> >
> > 
> >
> >             private void button1_Click(object sender,
> System.EventArgs e)
> >
> >             {   
> >
> >                   string Axapta_Parameter;
> >
> >                   axapta = new Axapta2();
> >
> >                 
> axapta.Logon2("datasistem","riva","spk","","SPARK","","",0,0,0);
> >
> >                   Axapta_Parameter=textBox1.Text;
> >
> >                   Axapta_Gonder(Axapta_Parameter);              
> >
> >             }    
> >
> >             public void Axapta_Gonder(string Axapta_Recete)
> >
> >             {  
> >
> >                   IAxaptaRecord MyRecord;
> >
> >                   MyRecord = axapta.CreateRecord
> ("UrunRecetesiOnay");
> >
> >                   axapta.TTSBegin();
> >
> >                   MyRecord.set_field("ReceteId",Axapta_Recete);
> >
> >                   MyRecord.Insert();
> >
> >                   axapta.TTSCommit();
> >
> >                   MessageBox.Show(this,"Axapta'ya Veri
> Aktarýldý.","Axapta'ya Veri Aktarma");
> >
> >                   axapta.Logoff();
> >
> >             }
> >
> >             private void button2_Click(object sender,
> System.EventArgs e)
> >
> >             {
> >
> >                   axapta.Logoff();
> >
> >             }
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> > 
> >
> >
> >
> > [Non-text portions of this message have been removed]
>
>
>
>
>
>

> Yahoo! Groups Links
>
>
>

>
>
>
>
> [Non-text portions of this message have been removed]






Yahoo! Groups Links

Reply via email to