I have a pretty complex SQL statement that looks like this:
SELECT aspnet_Employers.active, aspnet_Employers.accountexecutiveusername, aspnet_Employers.created, aspnet_Employers.Title AS Contact,
SUM(aspnet_Employers.EmployeeCount) AS [# Emps], COUNT(aspnet_Signups.account) AS [# Email Addresses], COUNT(aspnet_ContactMe.username)
AS [# Contact Me], COUNT(aspnet_AppsSubmitted.account) AS [# Apply Now]
FROM aspnet_Employers LEFT OUTER JOIN
aspnet_AppsSubmitted ON aspnet_Employers.UserName = aspnet_AppsSubmitted.account LEFT OUTER JOIN
aspnet_ContactMe ON aspnet_Employers.UserName = aspnet_ContactMe.username LEFT OUTER JOIN
aspnet_Signups ON aspnet_Employers.UserName = aspnet_Signups.account
GROUP BY aspnet_Employers.accountexecutiveusername, aspnet_Employers.created, aspnet_Employers.Title, aspnet_Employers.active
It does work the way i want it, but the problem is, on my Gridview when i change the Employers accounts "Active" status either way, it changes the username field from the username of the account, to "null".
Why does it do this?
What would i change to prevent this from happening?
Thanks!
Maybe it is related to Page.IsPostBack?|||Sorry, i should have mentioned this. This is on my aspx page, not in the code behind file.|||Nevermind, i figured it out.
I was missing username boundfield for my update statement. When it's missing from the <fields> section, but it's in the update statement, it makes it null. Makes sense. Now i know.
Thanks
No comments:
Post a Comment