.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

C++ Q&A: Commas, Pseudocode, Operator =, and More

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

Advanced Basics: Revisiting Operator Overloading


On the conference circuit recently, I was speaking about some of my favorite new features in the Microsoft® . NET Framework 2. 0, using the content of three recent columns in this series as fodder. In my talk I sped through generics, operator overloading, and the BackgroundWorker component, all in the space of an hour (for the columns, see Advanced Basics: Being Generic Ain't So Bad, Advanced Basics: Calling All Operators, and Advanced Basics: Doing Async the Easy Way).

Ken Getz

MSDN Magazine September 2005

Syntax error (missing operator) in query expression

Good Day Gurus!

I have a Excel user application which has a user form (named 'Registo') that displays criteria and an image that has been entered in it's corresponding spreadsheet. This works the way it should.  There's also the ability to search the spreadsheet via a form (by clicking 'Pesquisar' button) this opens a search form. However, I having a bit of a problem with it. When I try to search for something it basically doesn't do anything at all. It just sits there. So I tried to debug it and I think I'm having a problem with either the JET db engine or somethign with teh query or maybe I don't have the correct reference.

I 'borrowed' this Excel application from another forum because it's exactly what I'm looking for! However, I suck at vb.

So I was hoping somebody could take a look at the code and see if I'm missing something?  I'm kinda' desparate to get this working because I'm been trying to figure it out for days and I'm running out of time.  Cry
Option Explicit

'constantes para auxiliar na verificação do código
Private Const Ascendente As Byte = 0

GridView Paging + Unsupported overload used for query operator 'Distinct'


The issue is two fold in my ASP.NET Web Application. I need to use a custom Distinct() via LINQ to SQL, and then assign thevar as a DataSource to a GridView. If I use the custom Distinct that implements IEqualityComparer, I get "Unsupported overload used for query operator 'Distinct'" exception. but if i somehow get past this, i get "The data source does not support server-side data paging" exception on GridView.DataBind(). here is the code:

distinct_employees =
    (from emp in wsq.LIT_Active_Employees
    where (String.IsNullOrEmpty(ssFirstName.Text) ? (emp.FIRST_NAME == null || emp.FIRST_NAME.StartsWith(String.Empty)) : emp.FIRST_NAME.Contains(ssFirstName.Text)) &&
            (String.IsNullOrEmpty(ssLastName.Text) ? (emp.LAST_NAME == null || emp.LAST_NAME.StartsWith(String.Empty)) : emp.LAST_NAME.Contains(ssLastName.Text)) &&a

Using the "IN" Operator with SelectCommand Parameter


Good morning everyone,

Any ideas how I can use an "IN" operator with a SelectCommand Parameter.



Where @DEPTS is a value stored in a Cookie.  Cookie("DEPTS").Value is "232,243,250"

I keep getting an nvarchar to smallint conversion error.  Has anyone ever tried to do this?

Mod (%) operator on x86 vs x64

Hi all , I need help for resolve a strange bug – when I use mod (%) operator on x86 all good , But on x64 I get sometimes NaN as remainder ( it usually happens with Angle = 0). I managed to reproduce that bug outside my code , but only with Angle = double.Epsilon (at my code it also happens with Angle = 0). class Program { public const double M_PI = 3.14159265358979323846; static void Main(string[] args) { double m_2PI = (2 * M_PI); double m_Angle = double.Epsilon; double mod = (m_Angle % m_2PI); //x86 mod = 4.94065645841247E-324 //x64 mod = NaN if (double.IsNaN(mod)) Debug.Write(mod); } } Regards , Shay

How to use 'Like' operator in XQuery?

Hi All, I've a huge XML. Following is the layout: <Root>           <Request ID="12160884">                    <Command ID="1" Item="Start_Loading" Error="" />                    <Command ID="2" Item="GetData()" Error="Unknown group 'Data'" />                    <Command ID="3" Item="End_Loading" Error="" />           </Request>           <Request ID="12161224">                    <Command ID="1" Item="Start_Loading" Error="" />                    <Command ID="2" Item="GetCompanyInfo()" Error="" />               &

//Operator '+' cannot be applied to operands of type 'L' and 'L'

  public L Mymethod<L>(L mydate, L myname) {   //it is getting following errro   //Operator '+' cannot be applied to operands of type 'L' and 'L'   return (myname+myname); }   Can any one give me help how to solve following error

Using equal operator in transact-SQL for ntext datatype column

Hi, I've a problem with using equal operator in transact-SQL for ntext datatype column. (SQL Server 2000) I'm using the following SQL command text. use NorthwindSelect * from Categorieswhere Description ='Seaweed and fish' If I use 'like' operator intead of '=' then the qurey retuns correct value. Any idea about this? Any help is appreciated. Regards, Julia

The data types varchar and date are incompatible in the add operator

On the following query I keep getting the error 'The data types varchar and date are incompatible in the add operator'.  As you can see I have tried to convert the date but doesn't seem to work.  The variable @Date1 will start off as a date.  Any suggestions? ' declare @Date1 date declare @SQL1 varchar(2000) set @Date1 = convert(varchar, cast(getdate() as date), 102) set @SQL1 = 'select * from tbl_1 where convert(varchar,cast(tbl_1.Current_dt as date),102) = '+@Date1+'' print @SQL1    LISA86

WebSecurity.Login Operator '==' erro?

Server Error in '/' Application. Operator '==' cannot be applied to operands of type 'string' and 'int' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '==' cannot be applied to operands of type 'string' and 'int' Source Error: Line 12: login_password = Request.Form["login_password"]; Line 13: var login_username = Request.Form["login_username"]; Line 14: if(WebSecurity.Login(login_username, login_password)){ Line 15: Response.Redirect("~/"); Line 16: } Source File: c:\login.cshtml Line: 14 Stack Trace: [RuntimeBinderException: Operator '==' cannot be applied to operands of type 'string' and 'int'] CallSite.Target(Closure , CallSite , Object , Int32 ) +155 System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +258 CallSite.Target(Closure , CallSite , Object , Int32 ) +167 Microsoft.WebPages.SimpleMembershipProvider.VerifyUserNameHasConfirmedAccount(Database db, String username, Boolean throwException) +798 Microsoft.WebPages.SimpleMembershipProvid

Not Equal To Operator (<>) Behavior

Can someone explain this behavior with the <> operator when used along with a variable as opposed to a hard coded value. I'm totally confused (: Thanks for the help! -- Scenario 1: Value 3 is hard coded if object_id ('tempdb..#t') is not null drop table #t GO SET ANSI_NULLS OFF GO create table #t (c1 int null) insert into #t select 3 insert into #t select NULL SELECT * FROM #t WHERE c1 <> 3 -- 0 rows returned ---------------------------------------------------------------- ---------------------------------------------------------------- -- Scenario 2: Value 3 assigned to variable @a and used if object_id ('tempdb..#t') is not null drop table #t GO SET ANSI_NULLS OFF GO create table #t (c1 int null) insert into #t select 3 insert into #t select NULL declare @a int = 3 SELECT * FROM #t WHERE c1 <> @a -- 1 row returned with NULL value.. Why..?? ---------------------------------------------------------------- ---------------------------------------------------------------- -- NOTE: Both the queries ve the ANSI_NULLS OFF  

Need to find all lines that have less than 9 commas and add two commas to the end of those lines

I have a .csv file which is missing commas at the end of some of the lines... each line should have 9 commas and I want to add commas to those that have less than 9.

Modal Popup inserting unnecessary Commas


I have a textbox inside modal popup. when i write some data into the textbox and hit ok it is appending unnecessary commas. How to remove them. 

Hide Commas in Number Field when Editing via DataView


I have a list that contains a number field that I am using to capture a numeric value, however I do not want the values displayed with commas (I am using the number column type to keep the user from entering text)  I am displaying the number field in a dataview on which I have enabled the Insert/Edit options.  When the user is inserting a new record the field does not display commas.  When the dataview is in display mode I am able to change the formatting of the value to remove the commas.  Unfortunately, I can not figure out how to remove the commas from the text box when the user is editing an existing entry.

MOSS 2007, SPD 2007


avoid like operator




I have a query i.e. select col1 from tab1 where col1 like '%p'

I have an index defined on col1.

How can i rewrite the query to make the index seek instead of index scan?

~Technology Analyst~

What is the maximum # of items for IN operator?

What is the maximum # of items for IN operator?  If possible, please provide the link to MS document containing such information.

Operator '>=' cannot be applied to operands of type 'string' and 'string'


I want to compare two lebel text , but i am getting this error..

Compiler Error Message: CS0019: Operator '>=' cannot be applied to operands of type 'string' and 'string'

Source Error:

Line 39:         Label2.Text = DateTime.Now.AddDays(7).ToString("MM/dd/yyyy");
Line 40: Label3.Text = DateTime.Now.ToString("MM/dd/yyyy");
Line 41: if (Label2.Text>=Label2.Text)
Line 42: {

plz reply me ...how can i compare greater than and greater than equal to values of labels...


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