# .NET Framework Windows Service and SQL Statements

**URL:** <https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892>\
**Category:** Open Q&A\
**Tags:** windows, deep-monitoring, sql\
**Created:** [March 25, 2025, 8:37pm UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892 "2025-03-25T20:37:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno\_camara](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bruno\_camara](https://community.dynatrace.com/u/bruno_camara)\
**Post date:** [March 25, 2025, 8:37pm UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/1 "2025-03-25T20:37:26Z")

</div>

I have a .NET Framework windows service with Deep Monitoring. Basically this windows service retrieve messages from a MSMQ queue and saves a record in a SQL Server database.

I can find traces originated from this process group while consuming messages from queue, but i can’t find the SQL statements that are being sent to the target the database, like I would see if it was an application hosted in IIS, for example.

Any idea why the SQL&nbsp; statements are not being collected inside a windows service that has Deep monitoring?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [March 26, 2025, 8:52am UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/2 "2025-03-26T08:52:31Z")

</div>

Hi,

I would say:

1. Deep monitoring enabled + process restarted.
2. Database framework supported.

Best regards

---

<div class="post-metadata">

**Author:** ![bruno\_camara](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bruno\_camara](https://community.dynatrace.com/u/bruno_camara)\
**Post date:** [March 26, 2025, 10:22am UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/3 "2025-03-26T10:22:16Z")

</div>

Thank you [@AntonPineiro](https://community.dynatrace.com/user/58682)

Regarding 1, checked.

Regarding 2, could you please provide the link where you get that table?

The windows service that is beinf deep monitored was build tartgeting .NET Framework v4.8, and is using vanilla [ADO.NET](http://ADO.NET) to communicate with the database.

When hosting a service in IIS, targeting the same .NET framework, and using [ADO.NET](http://ADO.NET), we can see the statements being collected. In case of the windows service, we cannot. So, there’s something here that I might be missing.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [March 26, 2025, 2:11pm UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/4 "2025-03-26T14:11:49Z")

</div>

Hi,

I have just edited my before comment because table was not correct.&nbsp;[ADO.NET](http://ADO.NET) is supported, you can see it [here](https://docs.dynatrace.com/docs/shortlink/section-technology-support#net)

 ![AntonPineiro_0-1742998294313.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/d/7da83916fc0987b3935bd3857e87a49c89cebe93.png)

Best regards

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [March 26, 2025, 3:26pm UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/5 "2025-03-26T15:26:01Z")

</div>

Hi&nbsp;[@bruno\_camara](https://community.dynatrace.com/user/87876)&nbsp;,

Sometimes the automatic instrumentation does not work. In this case I always try to use custom service detection to see missing requests and database calls.

But in your case maybe there is another issue if you can see the call details in the trace expect the database calls.

Best regards,

János

---

<div class="post-metadata">

**Author:** ![bruno\_camara](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bruno\_camara](https://community.dynatrace.com/u/bruno_camara)\
**Post date:** [March 26, 2025, 7:17pm UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/6 "2025-03-26T19:17:03Z")

</div>

Thank you.

I didn’t know about Custom Service Identification. It seems exactly what I need, since I want to see instances of windows service as “Services” in Dynatrace lingo. I’m gonna try to define the custom service (entry point and methods)

---

<div class="post-metadata">

**Author:** ![bruno\_camara](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bruno\_camara](https://community.dynatrace.com/u/bruno_camara)\
**Post date:** [March 28, 2025, 8:42am UTC](https://community.dynatrace.com/t/net-framework-windows-service-and-sql-statements/50892/7 "2025-03-28T08:42:41Z")

</div>

I just want to confirm that I managed to monitor the database calls inside the windows service, by using a custom servide definition as suggested by&nbsp;[@Mizső](https://community.dynatrace.com/user/47783)

Thanks for all your help.
