.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

UnCommon C# keywords - A Look

Posted By: Amit Mehra     Posted Date: September 14, 2009    Points: 2   Category :C#
This is really a weird topic to start with. But still I would like to give you an insight on some of the uncommon things that you may not have noticed while doing programming. I have framed them in 2 sections.

1st one for Undocumented Keywords, which you will not find anywhere, not even in MSDN Documentation, which are not listed to intellesense menu in visual studio.
2nd one for Documented Keywords which are uncommon or just being introduced to C#. Documented keywords which are uncommon can be found over MSDN.

View Complete Post

More Related Resource Links

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

Reserved and Contextual Keywords

Many programming languages, C# included, treat certain sequences of letters as "special".

Some sequences are so special that they cannot be used as identifiers. Let's call those the "reserved keywords" and the remaining special sequences we'll call the "contextual keywords". They are "contextual" because the character sequence might one meaning in a context where the keyword is expected and another in a context where an identifier is expected.*

How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

Foundations: Templates for Uncommon Controls


Charles Petzold demonstrates how Windows Presentation Foundation (WPF) templates let you turn common controls into uncommon visual objects.

Charles Petzold

MSDN Magazine January 2008

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

Permissions for Search Keywords and Best Bets

Do you know if it is possible for a user, which is not a Site Collection Administrator, to access "Site Settings / Search Keywords" admin page?Maybe by creating a new Permission Level or......   The reason for this, is that I have editors which I do not want to upgrade to Site Collection Admintrators, but they need to create Search Keywords and Best Bets.

Error occured while trying to add Keywords

All, The Farm is migrated from 2007 to 2010 When I add a keyword/best bet to the site, im getting the below error, and I think the file Keyword.aspx that Im accessing is a OOB one. No custom work in that page apart from a custom Masterpage, which works fine in all the other pages. But the keyword is added successfully ! Thanks in advance :)     Trying to use an SPWeb object that has been closed or disposed and is no longer valid. Trying to use an SPWeb object that has been closed or disposed and is no longer valid. 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.SharePoint.SPException: Trying to use an SPWeb object that has been closed or disposed and is no longer valid. Source Error: [No relevant source lines] Source File: c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\6ac7b2b2\bd184dc\App_Web_listkeywords.aspx.2a428413.eey9ytvu.0.cs    Line: 0 Stack Trace: [SPException: Trying to use an SPWeb object that has been closed or disposed and is no longer valid.] Microsoft.Office.Server.Search.Internal.UI.SearchAdminPageBase.ErrorHandler(Object sender, EventArgs e) +275 System.Web.UI.TemplateControl.OnError(EventArgs e) +1103

Can SharePoint 2010 Tag Cloud webPart show managed keywords tags only from Document Library

Can SharePoint 2010 Tag Cloud webPart show managed keywords tags only from a specified Document Library ? Also can i add multiple document libraries tagged for a single tag cloud webpart?

Putting multiple keywords remove best bets


If I add a search keyword lets say test , and define it to show up when the user types test then it works fine.  However for the search term if I type something like test another_word then the best bet does not show up.  I would expect the  test to still show up as a match.  From observation it seems like the best bet only works you type one word into the search box if you type more than one word then it does not work, is this correct?

If this is the case then I have the following problem.  In my search the user always excludes a specific word in the search so a typical search text would be searchword -excludeword .  The problem is that since the user is excluding a word (two words have been typed in) the best bet for searchword does not show up.  Does anyone have any solution to this?


How to make highlighted keywords clickable in WPF



I am using WPF application and I am using Text Block to show some news and the contents of the news I am storing in a list and comparing with other list. Common keywords from both the list I am storing in one list and highlighting it on the Text block where I am showing news. Till this I have done.

Now I want to make the highlighted keywords clickable and clicking on which I should send those keywords in the Text Box.

Can anyone help me in this.


Mohammad Farhan Khan

How to return matching keywords from sharepoint search web service


I'm writing an ISV page that is embedded in an iFrame within Microsoft Dynamics CRM 4.0 and it searchs both CRM and Sharepoint for matching candidates. Skills are stored in CRM entities and then Sharepoint Document libraries are searched for matching keywords in document resumes. I then merge the results together. However in the results I would like to show which skills (in crm) and keywords (in sharepoint) matched.

I have been playing arround with the Sharepoint Search Service Tool trying to find a way. The closest I can get is the Managed Search Property "Hit Highlighted Summary", but that won't gurantee every matching keyword to be returned when 5+ keywords are searched. I could search each keyword invidually and post process but that is very inefficient.

Is there a way to accomplish what i'm trying to do? (meta data about the search results about matching keywords?)

Thanks in advance,



SharePoint keywords and synonyms


How SharePoint keywords and synonyms work?

Is it mandatory to set the Best bets?

When I set a keyword as ‘home’ and synonyms as flat; apartment; house.

The search is not working properly.

 In search if I type flat and search its fetching the results for home, but if I use apartment or house it’s not working properly(only first word from synonyms is working fine).

After I set the synonyms, I did a full crawl also.

Is there any documentation how this keyword and synonyms work?


enterprise keywords vs managed metadata


Can someone please explain what the differences are between enterprise keywords and managed metadata?





In Microsoft Access, the SQL syntax of your query may say "Select Distinct" or "Select DistinctRow". Are you familiar with the difference? Learn how this impacts which records and number of records you see, and whether they can be edited.
Unique Values and Unique Records Properties

When creating a query in Microsoft Access, you might want to return only distinct or unique values. There are two options in the query's property sheet, "Unique Values" and "Unique Records":

Auditing for Keywords and Managed Terms




Is there any way to audit additions/changes to Keywords and Managed Terms?

We need to be able to identify anyone entering abusive information.

Custom Master Pages on View Scopes and Keywords fail?


So I'm applying the system master page on my sharepoint 2010 site and noticing that everything is branded (yes!) but a couple pages were not...

these are: viewscopes.aspx and listkeywords.aspx

Has anyone encountered this issue? ... I know that in 2007 the best approach were HTTPModules, and I tried it out here. The pages were branded BUT they crashed on certain operations and were simply not stable. I wonder if this is a product bug or?

Key thing to note is that these pages in the layouts folder do not have the new 'DynamicMasterPage' attribute declared on the directives section of the page. So I really can't figure out if they were intentionally left unbranded (unbrandable if you will).. help?!


Alex Talarico

Using Keywords in People Search


I am trying to add keywords and synonyms for Job Titles for my people search. For example when Some one searches for VP I was it to look for Vice President and CFO would be chief financial officer and so on.

I have tried adding the Keyword Phrase of "Vice President" and the synonym of VP and that does not work , and I have tried it in the reverse of this. Is there something I am missing?



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