.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

NULL for user who don't have appointment - UNION error ... LEFT JOIN doesn't work

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server


It's so silly what i'm trying to do.. I just need to catch the entire list of user and null for users who don't have appointment ....

I tried union but I've got an error, please help


Msg 205, Level 16, State 1, Line 2
All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

declare @SQL Varchar(4000)

declare @CRM_FilteredAppointment nvarchar(2000)
declare @CRM_FilteredSystemUser nvarchar(2000)

set @CRM_FilteredSystemUser = 'SELECT systemuserid, eu_reporthubname, fullname, businessunitidname 
 FROM FilteredSystemUser 
 WHERE businessunitidname = 'Spain'
--exec (@CRM_FilteredSystemUser)

set @CRM_FilteredAppointment = 'SELECT activityid, ownerid, regardingobjectid, subject, scheduledend 
 FROM FilteredAppointment 

set @SQL = ' 
 SELECT SU.systemuserid, SU.fullname, count(partyid)
 FROM (' + @CRM_FilteredSystemUser + ') AS SU
    (' + @CRM_FilteredAppointment + ') as Apt ON 
    SU.systemuserid = Apt.ownerid 
    FilteredActivityParty AS AP ON Apt.activityid = AP.activityid 
   AND (AP.participationtypemask = 8 OR AP.participationtypemask = 5) 
 WHERE Partyidname is not null 
group by SU.systemuserid, SU.fullname

View Complete Post

More Related Resource Links

Interesting error message with content organiser: Cannot resolve mailbox (null) to a valid user

Here is a site with content organiser site feature enabled, as well as the email integration feature. Emails are successfully delivered to the "Submitted Email Records" list, but is never routed to the Drop Off Library. (the content organiser web service works fine and the drop off library works as a custom send to destination and happily processes its rules. If I turn up the debug juice I get the error "Cannot resolve mailbox (null) to a valid user" for every item in any "Submitted Email Records" in the site collection. Area: Document managagement Category: Content organiser EventID: 8000 Message: Cannot resolve mailbox (null) to a valid user I have temporarily worked around the problem by email enabling the drop off library but it creates an intermittent race condition (similar to certain workflow and event receiver situations), so its not a real solution (and in fact I assume thats why the Submitted Email Records hidden list exists in the first place). I've run procmon, specifically focusing on OSWTIMER and nothing interesting shows up at all. The error message is intriguing and I can't really think of what it is trying to do. In troubleshooting I noted that this farm had configured inbound email but not outbound email. I have since rectified this and de/reactivated the content organiser features and reset the timer service and IIS, b

Update in formview doesn't work, but I don't get an error message?

I have a datasource:<asp:SqlDataSource ID="MySQLProfielDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:WAPMySQLConnStr %>" InsertCommand="INSERT INTO usergegevens(UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum) VALUES (@Param1, @Param2, @Param3, @Param4, @Param5, @Param6, @Param7, @Param8, @Param9, @Param10, @Param11, @Param12)" ProviderName="<%$ ConnectionStrings:WAPMySQLConnStr.ProviderName %>" SelectCommand="SELECT UserId, Geslacht, Voornaam, Tussenvoegsel, Achternaam, Adres, Huisnummer_toev, Postcode, Woonplaats, TelnrV, TelnrM, Geboortedatum FROM usergegevens WHERE (UserId = @Param1)" UpdateCommand="UPDATE usergegevens SET Geslacht = @Param1, Voornaam = @Param2, Tussenvoegsel = @Param3, Achternaam = @Param4, Adres = @Param5, Huisnummer_toev = @Param6, Postcode = @Param7, Woonplaats = @Param8, TelnrV = @Param9, TelnrM = @Param10, Geboortedatum = @Param11 WHERE (UserId = @Param12)" onselecting="MySQLProfielDataSource_Selecting" onupdating="MySQLProfielDataSource_Updating" onselected="MySQLProfielDataSource

MVC doesn't work once is published in the WEB, "Error 404 Page Not Found" vs2010 iis7 mvc 2rc2 I up


Hi Everyone.

 I'm doing the samething in my two differents pc.

1) Windows 7,  vs2010 rc, mvc 2rc2, .Net 3.5

2) Winodws xp, vs2008, mvc 2rc2, .Net 3.5

My Hosting is in GOdaddy IIS 7, .Net 3.5.

I created a new project in both computers, i build it, i copied the 3 dll's files in the bin folder (System.Web.Mvc,  System.Web.Routing, system.Web.Abstractions), and i publish them...., i go to my website (www.luisbragagnolo) both same problem "Page Not Found"

 I tried many blogs...many advices...nothing yet....

 Any other new Advice people? Thankssssssss

Logout doesn't work on all pages, and also User.IsInRole, UrlRewrting ?



I can't logout from my main page and also from the other pages when I'm using UrlRewriting rule without file extension. If I open the page with .aspx at the end, logout process working just fine. For example:

www.mydomain.com => logout impossible

www.mydomain.com/contakt => logout impossible

www.mydomain.com/contakt.aspx => logout working fine


Also when I log into system, the User.IsInRole method doesn't work for all pages used in application. It's working properly for the pages placed in main folder, but it's not working for the page placed in /folder/subfolder/somepage.aspx . Url showing in browser for this page is www.mydomain.com/somepage . How can I check If user is in role for that page ? It's always return false.

Does anybody got this problem ? How to solve it ? Please share any knowledge..

SSRS text box action - Go to URL doesn't work with left indent



May I know anyone manage to get 'Go to URL' work, together with values on left indent properties?

For example, I have following report interface, with hyperlink & left indent on each items:-





Everything works fine in BIDS - but the hyperlink not working properly when deployed and view in Reports Manager! According to http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/b9d0cbf1-b278-40e8-8da4-6871d49661d9 post, both 'Go to URL' and left indent doesn't work at the same time. The hyperlinks work fine again when after removed the left indent.

Does this mean I can only use either 'Go to URL' or 'left indent', but NOT BOTH at the same time! Any workaround?

Many thanks :-)




create user wizard login error message dont show in a message box?




i am using create user wizard and capturing other information within content template when a new user

registers. Some of the textboxes are binded to required field validators.


there is a validation control on the page and ShowMessage box is True.

If they dont complete some of the text boxes then the message box pops Up with the error message.

It does not however include information errors like "User already exists" or Email address already exists

from the create user wizard membership  UserName and Password Textboxes


is it possilbe to hook all of these up so I get one message box with all errors including membership ones?




Category attribute of user control property does not work correctly in categories tab.



I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Category("Styles"), DefaultValue(""), Description("The value for formating something.")]
public String MyFormatProperty
set { /* the code for set */; }
get { /* the code for get */; }

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

Thanks, S.

"Type ASP.x is not defined" error for dynamic user control when publishing updateable


I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)

I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?

VS 2008 / .NET 3.5 sp1

The code follows (web.config is the default from Visual Studio).

Many thanks, Dave


<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %>

    Simple control


Partial Class _SimpleCtrl
    Inherits UserControl

    'Nothing to see here.

End Class


<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"

Error on Display user's fullname using Active Directory in asp.net using vb.net



wi As System.Security.Principal.WindowsIdentity =  _System.Security.Principal.WindowsIdentity.GetCurrent()



Dim a As String() = HttpContext.Current.User.

linq and max, if return null return error


hi there
i have this query :

var result2 = (from TH in DB.Threshold
                          where TH.ProductSKUID == int.Parse(HID_ProductSKUID.Value)
                          select TH.ThresholdID).Max();

the problem is that if this query does not find any items, return null, so thow exception
how can i do to return 0??

error in MicrosoftAjax.js: Cannot read property '_notified' of null


I am cross testing my project with multiple browsers: IE7, Firefox and Chrome.

One one page I have a dynamically built table with two DropDownLists and CascadingDropDown extenders. Maybe the only thing special about the drop down lists is, that I add a "onChange" for the second drop down list in each row which shows or hides the list depending on the value populated from the web services.

All of this works perfectly in IE7 and Firefox, but Chrome does not execute the JavaScript in the onChange attribute and the error console says:

Uncaught TypeError: Cannot read property '_notified' of null

file upload in Create User Wizard Created User event with UpdatePanel Tag wont work?



In my Create User Wizard1 Created User Wizard Event, I am collecting extra information from text boxes and allowing

the user to uplad a file.



I have put the Submit button within an Update Panel Tag but since I have done this it does not work.

Is there a way round it. In this situation would you use a trigger.?


<br />

  <asp:UpdatePanel ID="UpdatePanel2" runat="server">

  <asp:Button ID="StepNextButton" runat="server"  CommandName="MoveNext"  align="middle"
                                            Text="Submit my Profile" />

Visual Web Dev 2010 error or new user error?


In a new web app, using the fresh new build, I added some fields that I wanted processed during login, i.e. common Profile stuff... added them to web.config.... sadly it appears that Studio 2010 will not automatically create a ProfileCommon class from ProfileBase, as previous studio web IDE's would do - that was frustrating for a bit, then I just created my own class... but that led to this interesting problem.

When populating the new profile attributes, the code behind class could not resolve any of the textbox referenced, all showed as not defined... figuring it was something simple, I kept going... added a customValidation control I needed, but though I double clicked the event in studio, and it dutifully created the stub code for me... the event never fired.

Determined to locate the problem I poored through forum entries and every reference I could (found lots of folks complaining about the profileCommon class stuff which is what led me to create my own class finally) -- but nothing specific to the problem I had of not seeing defined controls that were clearly there and working nor my customValidator control.

But... all of the code samples I saw - none had the ContentTemplate section... curious I removed that section, other items started to fail that were logical (header tags, etc.) but, my code behind section snapped back into order, intelisense n

Error "user does not have permission to perform this operation" with User Instance = True.


I setup SQL Server 2005 / SQL Express. All works fine in SQL Server 2005.

I am connecting to a SQL Database from VS 2005,  Tools/Connect to Database. I set the Data Source to "Microsoft SQL Server Database File (SqlClient)" (meaning SQL Server Express) and User Instance = True, and Integrated Security = True.

The above is working successfully on all machines except my Laptop. On my Laptop, I am getting this error "user does not have permission to perform this operation". On my Laptop, if I change User Instance = False, it works fine. Also, If I connect to SQL Server 2005 it works fine only if User Instance = False.

I tried all kind of security changes, nothing worked. For example, I setup Everyone as Full Control for the Folder and the MDF File of SQL Server. I gave my user ID as sysadmin role in SQL Server Express. Also, I enabled creating User Instance form SQL Server Express, Nothing is working.

Appreciate your help.


When I use 'publish', site doesn't work when i post data


Arrgghh, I am so tired of dealing with stuff like this

I've got a project, when I put up on another server I point two sites in IIS6 to it

i have

http://www.main.com  pointing to the folder the files are in


http://www.anotherofoursites.com/main pointing to that same folder in it's own "Virtual Application" or whatever IIS calls it when you put a folder into it's own 

If I just "Build" and push all the files up.. both work without issue and as expected...  but when I use "Publish" to precompile, the site works until I post, and then i get nailed with:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Ajax Asyncfileupload doesn't work as soon as I put it in a control


Hi guys,

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error: 


Here's my front-code:

<%@ Page Language="VB" MasterPageFile="~/masterpages/mpSqueletton.master" AutoEventWireup="false" CodeFile="frmAdmGestSocietes.aspx.vb" Inherits="adm_frmAdmGestSocietes" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script type="text/javascript" language="javascript">    
        function uploadError(sender,args)
          document.getElementById("<%= lblStatus.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMes

User Alerts don't work


Hi there

our webmaster added a group and a few users on a page via Actions -> Alert Me -> Send Alerts To
the users are also viewable via Site Actions -> Site Settings -> User alerts
all neccessary users or groups are added for alerting.

even if everything looks okay, on just one site the alerting does not work when a user uploads a new document.

question: does anybody have any clue what i could test or do to correct this?

as i told, the same users work on another site, so it's not possible, that users or groups are not mail enabled.

thanks for any help.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend