.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

Getting a count of how many comments have been posted to an item (noteboard).

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :SharePoint
I have created a list, and added a noteboard to the DisplayForm.aspx page. The functionality works great, users can leave comments and the comments are associated with the selected item. The problem i'm having is accessing the content from the noteboard, Is there any way I could create a data view that retreives the number of comments associated with an item? The noteboard does not allow connections, so it makes it very difficult for me to send a comment count to another webpart.

View Complete Post

More Related Resource Links

Comments count in noteboard webpart



I am building a custom visual webpart where i am embedding ootb socialcomment webpart. I need to show the total number of comments posted in that webpart. How do I address this issue.




How do I count occurences of an item in an ArrayList?

Hi All- Please help, I'm stuck!  After executing a query with LINQ to SQL, the result I have is an arraylist (.ToList)  of items with ID numbers.  The number of items and their occurences will vary with each query.  I would simply like to count the occurences of each specific ID in the list.  How do I do that??  The only count function I know of (.count() ) is for a count on the entire list.   I've also I've been reading on how to loop through the list items but I don't understand how I can do that if I don't know how many specific ID's there will be from each query result.    

Column to show count of attachments uploaded for each List item in MOSS 2007


We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

List Item View Count - Blog Site



Is there any way we can find how many times the Article is viewed in a Blog Site.

In Blog Site there is a list called Posts and I have List Items like Article1,Article2, Article3........  Is there anyway i can display the Article View count on the Post.aspx page ? i want display on each article how many times the page is viewed.

Please let me know how to acheive this ..

Thanks in Advance


Getting the Item Count of a View. Fast. For a Large View.


I am trying to get the count of the items a view contains programatically. The scale I am working with is 30-50000 items views. I came up with two ways of doing that. Rather unfortunately both of them lack in performance.

1) Create an SPQuery based on the SPView Query property. Set the SPQuery.ViewFields property to return just the ID field (best performance that way) and set the query RowLimit to uint.MaxValue. Invoke SPList.GetItems with the query as an argument. Then get the Count property of the SPListItemsCollection object returned.

The query runs pretty fast (milliseconds on VM) up to the point where I try getting the Count property of the SPListItemCollection. That takes like 10 seconds. It feels as if it's actually enumerating the collection.


2) Create a SPSiteDataQuery along the same pattern as above. Run it on the list where the view is defined. Get the Rows.Count property of the returned DataTable. 

It's the query that takes like 10 seconds to complete in this approach. So I am pretty much getting the same speed as in the previous approach.



So, can you guys think of some other way that I can get the count of items in a view? A faster way than the ones above?

Retrieve and add comments to a noteboard webpart


Hi i have a web part page where i added a note board webpart.


I am trying to add a new comment to the note board and to retrieve existing comments using the following  code from  an application page


<%@ Assembly Name="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Assembly Name="Microsoft.Office.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Display single item from List using XSLT and show total count of all items in list


I have a simple SharePoint 2010 list named "Tips". Each item consists of a Title and Description. I want to display a single item at a time in a sidebar on my site with arrows to advance to the next or previous item in the list. I've been able to accomplish this pretty easily using OOTB SharePoint XSLT list view web part settings and AJAX. However, when I tell the web part to only display 1 item at a time the pager always says it's showing item "1 of 1" or "2 of 2". It won't show the total number of items from the list. I'd like it to show something like item "1 of 25", etc. How do I get it to display the total count of items from the list?  I've looked at possibly using aggregation attributes on a FieldRef but I've not been able to get anything to work. I'm not even sure that's the right place to be looking. I'm needing to accomplish this without writing a custom web part. 


MS Word style comments in asp.net



I need to create a system, that will be similar to ms word style comments. So the idea is the following: on the page there are a pack of text boxes labels and so on, and user need have the way to comment each control, and save commented text, for example to DB, so the others can reed comments too.

I tried PopUpControlExtender, but it works in single way, and i cannot view all the popups in one time. Or may be i missed something and there is a way to popup all the controls at one time? 

Therefore, are there any known solutions for a discribed task, based on PopUpControlExtender or something else?

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







LINQ to SQL - Validating if item is in Database, but if item is not items not inserting into databas



I am new to this, so bear with me.  I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already.  If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database.  If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario.  I have tried moving the if and else statement to different parts of the code but can't quite figure this one out.  Any help would be apprecaited, attached is the code.  This code is set to a button press.  As a matter of fact, if you see any other errors along the way please feel free to point them out. 



    protected void enterBTN_Click(object sender, EventArgs e)
        //make new data context

        SHCDataContext insNewAll = new SHCDataContext();
        //LINQ to check if customer exists in database
        var checkExisting = from c in insNewAll.Customers
                            where c.custLastName.Contains(custLastNameTB.Text.ToString())
                            select c.custLastName;
        //make list to store values

Print row count on Label



I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 

Count words in the ascx file



I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

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!

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

Basic Instincts: Documenting Your Code With XML Comments


XML comments provide an easy and effective way to document your code. We'll show you how to use and customize XML comments in your Visual Basic projects.

Lisa Feigenbaum

MSDN Magazine May 2009

Toolbox: XML Comments, Online Payments, and More


This month, online payment processing services, XML comments the easy way, and more.

Scott Mitchell

MSDN Magazine June 2007

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