# Use the tables from external DB , and bound to grid

**URL:** <https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447>\
**Category:** Developer Forum\
**Created:** [January 30, 2025, 1:02pm UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447 "2025-01-30T13:02:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@John\_Smith](https://www.dynamicsuser.net/u/John_Smith)\
**Post date:** [January 30, 2025, 1:02pm UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/1 "2025-01-30T13:02:18Z")

</div>

Hi all,

I want to use tables from an external database and bind them to a GridView control to display the data.

Is it possible to use a database other than AXDB? I know we can perform CRUD operations using `SqlConnection`, but I want to integrate the external database throughout the entire application.

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [January 30, 2025, 1:43pm UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/2 "2025-01-30T13:43:12Z")

</div>

You can’t bind grid to a table that doesn’t exist in AOT. What you can do is creating a temporary table in AX, populate it with data from another database and use this temporary table in a form.

By the way, which version of AX are you using?

---

<div class="post-metadata">

**Author:** ![Mc\_Divit](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Mc\_Divit](https://www.dynamicsuser.net/u/Mc_Divit)\
**Post date:** [January 30, 2025, 9:07pm UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/3 "2025-01-30T21:07:28Z")

</div>

You can use `SqlConnection` (or any other database provider like `OleDbConnection` or `OracleConnection`) to connect to your external database. Make sure the external database is accessible and that you have the necessary credentials to connect to it.

---

<div class="post-metadata">

**Author:** ![John\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@John\_Smith](https://www.dynamicsuser.net/u/John_Smith)\
**Post date:** [January 31, 2025, 3:44am UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/4 "2025-01-31T03:44:21Z")

</div>

Thanks!  
Currently working on Dynamics 365 FO

---

<div class="post-metadata">

**Author:** ![John\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@John\_Smith](https://www.dynamicsuser.net/u/John_Smith)\
**Post date:** [January 31, 2025, 3:45am UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/5 "2025-01-31T03:45:46Z")

</div>

it means we have to create the table , if want to use the as datasource for Query, form etc…Correct?

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [January 31, 2025, 6:05am UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/6 "2025-01-31T06:05:24Z")

</div>

Yes, you indeed need a table. You can’t have a data source without a table. Try to create such a data source and you’ll quickly see that.

---

<div class="post-metadata">

**Author:** ![John\_Smith](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@John\_Smith](https://www.dynamicsuser.net/u/John_Smith)\
**Post date:** [January 31, 2025, 6:28am UTC](https://www.dynamicsuser.net/t/use-the-tables-from-external-db-and-bound-to-grid/87447/7 "2025-01-31T06:28:34Z")

</div>

Thanks, @MartinDrab, for your guidance.
