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: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of andreas_paulsson_cimkey_se
Sent: 16 MayÄs 2005 Pazartesi 12:12
To: development-axapta@yahoogroups.com
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 development-axapta@yahoogroups.com, "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