# Using Dynamics Ax 2012 tables from Visual Studio

**URL:** <https://www.dynamicsuser.net/t/using-dynamics-ax-2012-tables-from-visual-studio/37290>\
**Category:** Developer Forum\
**Created:** [April 26, 2012, 8:25am UTC](https://www.dynamicsuser.net/t/using-dynamics-ax-2012-tables-from-visual-studio/37290 "2012-04-26T08:25:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterparra](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@peterparra](https://www.dynamicsuser.net/u/peterparra)\
**Post date:** [April 26, 2012, 8:25am UTC](https://www.dynamicsuser.net/t/using-dynamics-ax-2012-tables-from-visual-studio/37290/1 "2012-04-26T08:25:38Z")

</div>

Hi!

I am using Ax tables on my .NET code in order to read or write some records but I have seem that after creating some thousands of instances I get an error.

After using my records I call on them the dispose method and I even make them null.

Should I have something else to avoid this problems?

I do all my stuff in the same session and transaction. For the moment I have solved my problem dividing my work in smallest pieces and logon and logoff my session between them but I consider this not very elegant and I would like to discover what I am doing wrong.

Thanks!!

---

<div class="post-metadata">

**Author:** ![peterparra](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@peterparra](https://www.dynamicsuser.net/u/peterparra)\
**Post date:** [April 26, 2012, 8:42am UTC](https://www.dynamicsuser.net/t/using-dynamics-ax-2012-tables-from-visual-studio/37290/2 "2012-04-26T08:42:53Z")

</div>

Sorry! 🙂

I have reviewed my code and in fact I forgot the dispose and null for the table objects in one place. Then. It is very important to free your table objects in your .NET code!!
