# C# and Functions like system.tag.queryTagHistory

**URL:** <https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296>\
**Category:** Ignition\
**Created:** [May 5, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296 "2023-05-05T00:59:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Allen](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Paul\_Allen](https://forum.inductiveautomation.com/u/Paul_Allen)\
**Post date:** [May 5, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296/1 "2023-05-05T00:59:27Z")

</div>

Good Day,

Wondering if a C# Windows Form App has the ability to interface with the functions Ignition has like 'system.tag.queryTagHistory', etc? Strictly interested in the functions that are related to historical data and alarm data. Or does it make more sense to just query the actual database that holds that data directly?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [May 5, 2023, 1:16am UTC](https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296/2 "2023-05-05T01:16:52Z")

</div>

This is the approach I would use:

> [@Paul\_Allen](#):
>
> does it make more sense to just query the actual database that holds that data directly

If I were to create an stand alone app in Visual Studio for purposes of displaying tag history, I would point my data adapter at the database, and get the information directly from there.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 5, 2023, 1:20am UTC](https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296/3 "2023-05-05T01:20:54Z")

</div>

You could query the DB directly or set up WebDev endpoints that you call from your C# application, which in turn do whatever necessary inside Ignition’s scripting environment.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 5, 2023, 1:22am UTC](https://forum.inductiveautomation.com/t/c-and-functions-like-system-tag-querytaghistory/73296/4 "2023-05-05T01:22:06Z")

</div>

You could relatively easily use the WebDev module to write a simple API that would run the functions you need and return the data to you.

@Kevin.Herron beat me to it 😄
