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

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

An expression of non-boolean type specified in context where a condition is expected, near ','.

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Sql Server

An expression of non-boolean type specified in context where a condition is expected, near ','.

SELECT Code, Name
FROM DimCounty c
WHERE PublicationId = 44
and ((c.Name = @CountySelection) OR 
((c.Code BETWEEN '001' AND '102') AND
((@CountySelection) = 'ACTUAL')) OR
((@CountySelection) = 'ALL'))
I am gettting an 'An expression of non-boolean type specified in context where a condition is expected, near ','.' when I try to run this query in reporting services.

View Complete Post

More Related Resource Links

Object expected error


<input type="button' onclick="timeoutCheck()" value="Click Me!" />

it tells me Microsoft JScript runtime error: Object expected


timeoutCheck() is my script function that i declared above the input tag

can anyone tell me why i am getting this error

hello i need help , any ideas are welcome i have been working on this for two weeks now and cannot seem to be able to advance

Implicit-type lambda expression: is it possible?

Hi all, i was plaing around with LINQ and lambda expressions. I was trying to find duplicated files in my system. After a while a realized that duplicated could mean: - same name - same size and extension - ....   So i wrote this code: DirectoryInfo rootDirectory = ....; var groupFiles = selector => rootDirectory.EnumerateFiles("*", SearchOption.AllDirectories).GroupBy(selector).Select(g => new { g.Key, Info = g, Count = g.Count() }).Where(g => g.Count > 1); var groupsByName = groupFiles(f => f.Name); var groupsBySize = groupFiles(f => new { f.Length, f.Extension}); But i get the following error: Error 1 Cannot assign lambda expression to an implicitly-typed local variable So i tryed to make the type explicit and i realized that is not so easy. So what i'm missing?! IMPORTANT. 'm not tying to have the code working. I can solve the issue by duplicating code (even if i hate to do that) I'm rtying to improve my skills with LINQ and Lambda Expressions. Thanks all!!  

infopath 2007 Expected value type: end-of-string ! calculated field

Hello I am using infopath since there is no field with type date and time in InfoPath 2007. I created three fields one for date one, for hours, and one for minutes then I created forth field that concatenate the values of the three fields this field will be used as column in form template library used by my form. All seems good so far but when I tried to concatenate those fields go the following error Expected value type: end-of-string how can I solve this ? my xpath looks like ../my:calmomoDate../my:cbmomoHours:../my:cbmomoMunites Thanks  Momo

Arithmetic overflow error converting expression to data type smallint

Can anyone tell me what exactly this means? Arithmetic overflow error converting expression to data type smallint. 

Data type mismatch in criteria expression.

Protected Sub btnSave_OnClick(ByVal sender As Object, ByVal e As EventArgs) Dim StartDateYear As Integer = Int32.Parse(2000 + tbStartDateYear.Text) Dim StartDateMonth As Integer = Int32.Parse(ddlStartDateMonth.SelectedValue) Dim StartDateDay As Integer = Int32.Parse(ddlStartDateDay.SelectedValue) Dim startDate As Date = New Date(StartDateYear, StartDateMonth, StartDateDay) Dim folderStartDate As String = Convert.ToDateTime(startDate).ToString("dd.mm.yyyy") Dim projectName As String = tbProjectName.Text Dim projectCategory As String = ddlProjectCategory.Text Dim projectID As String = "" Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|MOPPS.mdb;") Dim insertSQL As String = "INSERT INTO Projects([Project Title], [Start Date], [Project category]) VALUES (@projectName, @startDate, @projectCategory);" Dim insertCommand As New OleDbCommand(insertSQL, objConnection) Dim IDSQL As String = "SELECT [ProjectID] FROM Projects WHERE [Project Title]='" & projectName & "' AND [Start Date]='" & startDate & "' AND [Project category]='" & projectCategory & "';" Dim IDCommand As New OleDbCommand(IDSQL, objConnecti

Creating a workflow condition based on document type

Hello! I'm creating a workflow for a Document Library. I only want the action in the workflow to be executed on the condition that the document is of a certain document type. Any suggestions how I should do that? Thanks!

A new expression requires (), [] or {} after type ??

Hello - I am fairly new to C# and I am having trouble with a line of code highlighted below. I get a
error: "A new expression requires (), [] or {} after type" Can someone help? Thanks
namespace BackgrountPrint
 class Program

       public BackgroundPrint.ReportService.ReportingService rs;
        public BackgroundPrint.ReportExecution2005.ReportExecutionService   rsExec;

        static void Main(string[] args)

           ReportService.ReportingService rs = new BackgroundPrint.ReportService.ReportingService

           rs.Credentials = CredentialCache.DefaultCredentials ;



Correct Boolean type when designing database table?


In my VB.Net code I am using boolean type and it is later stored through a stored procedure to a MS SQL database table. I have so far allways been using "int" as the column type in database table because there is no Boolean type to choose from when designing the columns of a table in the MS SQL Express?

Is it correct to use the column type int for storing Boolean values?

/Kontorslokaler Stockholm

>>Object of type 'System.Boolean' cannot be converted to type 'System.Byte[]'.



I am trying to upload a picture into database using FormView insertItemTemplate. 

FormView is bounded by objectdatasource.

To upload, I placed FileUpload control inside insertItemTemplate.

In table the dataType is image.


Object of type 'System.Boolean' cannot be converted to type 'System.Byte[]'.

Any swift reply would be appreciated. Thanks.


SSIS 2008-Variable Expression Type Cast Syntax Error


Hi all members.

I need to ask for the following code. I need to convert the variable into a string.

"Select Distinct convert (int ,A.CustomerCategory) as AccountReceivableCategoryID, convert (varchar(40), B.Text) as AccountReceivableCategoryNameE
from Inkunde A , inpara B
where A.CustomerCategory= B.SearchItem
and B.Language1 = 'EN'
and B.ParameterName = 'CATEGORY'
and A.CustomerCategory = (DT_STR,200,1252) "+  @[User::CategoryID] +"
Order By A.CustomerCategory"

Kindly any member let me know, How to correctly use the Type Cast fucntion in variables

Thanks and Best Regards,


ListData.svc fails if list has calculated column with Yes/No (boolean) return type


I have a list with a calculated column whose return type is Yes/No.  If I try to browse to the list or a list item using REST via ListData.svc, I get the error "An error occurred while processing this request".  Can't seem to find anything in 14\LOGS or the System or Application event logs.  I've tried multiple calculation formulas such as:



Both display "Yes" when viewing through the SharePoint UI and are sortable and filterable.  If I change the calculated column return type to anything else (single line of text, currency, date/time, etc.) and update the formula as necessary, ListData.svc displays the list item XML as expected.  If I replace the calculated column with a regular column whose type is Yes/No, ListData.svc displays the list item XML as expected.

Is this a known bug?  Is there a workaround (other than manually casting to bool in my code)?

Data type mismatch in criteria expression: date



I am getting a "Data type mismatch in criteria expression" error when trying the following SELECT statement.

strdt and spdate are Date types in my vb codebehind and the Contract field name is a DateTime field.

thanks for your help



nmxSQL As String = "SELECT * FROM Nymex WHERE (NymexID='" & nymID & "' And Contract>='" & strdt & "' And Contract<='" & spdate & "')"

Error 2 Type or namespace definition, or end-of-file expected


Hi frnds,

I am new to this programming.. I am trying to download files from a specific folder in ftp server. after downloading those files i want to store in my computer. . I got the code on internet but wen i am trying i am getting this error Error 2 Type or namespace definition, or end-of-file expected. .  please help me very urgent. here is my complete code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Net;
using System.Text;
using System.Runtime.InteropServices;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e)
        string[] files = GetFileList();
        foreach (string file in files)

        public string[] GetFileList()
            string[] downloadFiles;
            StringBuilder result = new StringBuilder();
            WebResponse response = null;
            StreamReader reader = null;
                FtpWebRequest reqFTP;
                reqFTP = (FtpWebReq

ODP.NET doesn't support boolean type


I have a large existing stored procedure who's interface I cannot change that has several parameters of type boolean. ODP.NET doesn't support a boolean type and I get an error when trying to access this proc via .NET using a different data type. Does anyone have a solution to this?

Accessing a session variable in html for a boolean expression


I've defined a session variable in my Session_Start procedure

        void Session_Start(object sender, EventArgs e)


        <other stuff>

                string sAdmin= bAdmin.ToString();

                Session["SessionAdmin"] = sAdmin;



Then in my masterpage I want to use the Session Variable to conditionally show some links in a list.

How do I write the Boolean expression to correctly access the session variable SessionAdmin?

Here's what I have:

       <div id="menu">


            <li><a href="/EmployeeTime.aspx">Employee Time</a></li>

            <% if (  *** a Boolean expression involving Session variable "SessionAdmin" *** ) {%>


Arithmetic overflow error converting expression to data type int.


I have a table with a row called row1, this row1 is a bigint and has values from 0  To  4278190080


I am running a query such as: select top 1 * from tableA where row1 <= (((73*256+62)*256+53)*256 + 12)


How can I get this to work? I tried to do where cast(row1 as float) <= ....... but I get the same error.

Client found response content type of '', but expected 'text/xml'.


I migrated our SSRS database from Windows 2003 32 bit, SQL  Server 2005 to Windows 2003 64 bit and SQL Server 2008 R2.

The report manager loads and SSRS reports run ok.

In one of our website, it connects to the SSRS web service and list a list of reports under specified folder in a listbox control.

It was working in our original Windows 2003 32bit server with the same settings, but we are getting error when calling listchildren method:

[InvalidOperationException: Client found response content type of '', but expected 'text/xml'.
The request failed with an empty response.]
   System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +413317
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +300
   WebPortal.ReportServer.ReportingService.ListChildren(String Item, Boolean Recursive) in C:\Projects\OSCAR\WebPortal\Web References\ReportServer\Reference.cs:832
   WebPortal.Components.UIBinder.BindReportList(ListBox listbox, String reportFolder, String url) in C:\Projects\OSCAR\WebPortal\Components\UIBinder.cs:761
   WebPortal.WebForm4.BindData() in C:\Projects

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