Avatar of djcheeky
djcheekyFlag for United States of America asked on

TableAdapter SQL Commands not appearing under SQL Profiler


I am using a TableAdapter in an ASP .NET application (C#) that does a couple of standard queries, namely a GetAll, Create, Update, Delete, GetByID.

The problem I am having is a very strange one.
When I run the GetAll function, data is returned fine and the SQL statement shows under SQL Profiler.

However, when I run the Create, Update or GetByID methods, I get data fine, but the Insert,Update or Select statmenet does NOT appear under SQL Profiler.

Why is this? Data is being retrieved without hassle - but when I want to go to SQL Profiler to view the query that was executed, nothing displays. The only time it ever displays is when the GetAll() query executes.

Microsoft SQL ServerC#ASP.NET

Avatar of undefined
Last Comment

8/22/2022 - Mon
Guy Hengel [angelIII / a3]

what events to you "trace" in the sql profiler?

SQL Start Statements
Guy Hengel [angelIII / a3]

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Hi - It seems that the TableAdapter actually uses a custom Stored Proc to execute the query as seen in the snippet below. So I actually had to track Stored Proc events in Profiler as well.

Thanks for the advice.

exec sp_executesql N'SELECT     provinceId, provinceCode, provinceDescription, provinceCreateStampId, provinceCreateStampDate, provinceUpdateStampId, 
                      provinceUpdateStampDate, provinceIsActiveYN
FROM         mtn_province
WHERE provinceId = @provinceId',N'@provinceId int',@provinceId=3

Open in new window

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck