.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

Parsing Words from Multiple Recordsets - Returning With Word Counts

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

I've had too many sleepless nights trying to work this out - I hope I can get some help here.

I have three distinct ADO recordsets that I need to parse words from and return to the client with sorted full word counts (less a predefined dictionary of innocuous words e.g. a, an, the, of.) across all three, references to the original record and references to the original source. The user needs to be able to drill in and out of this result set.

I'm going to simplify the layout for clarification purposes.

Let's say each data source has three identical fields 'updatedTime' (DateTime), 'text'(VARCHAR(255)) and 'ID'.

User goes to the site and searches for the word 'frog'.
User is returned with a word count of every record that has the word 'frog' in the 'text' field sorted by the top count down.
'green' 18 times in table A, 12 times in table B, 22 times in table C
'hop' 16 times in table A, 13 times in table B, 6 times in table C.
'roadkill' 12, 11, 4
'red' 10, 12, 3
And so on.

User clicks on the word 'green'.
Now only words with both 'frog' AND 'green' in the original record show up (again, with the counts and sorted by count).
A breadcrumb is built, so the user can click on 'frog' again to kill that filter.
User decides he doesn't want the default timeframe (6 months) and adjusts a filter

View Complete Post

More Related Resource Links

Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

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?

Autocomplete with multiple word suggestions, How can we do in Asp.Net with Ajax?


Hi All,

Could you please let me know the process to get multiple word suggesions for a text box in asp.net using Ajax.  

Actually I got a solution for that,


But it used Atlas. When I am running with this code in my application, it is conflicting with Script Manager that is already there in Masterpage.

How can I overcome that problem. Is there any built-in solution in latest versions of Ajax?


Thanks in Advance,

Sateesh Nagalla,



Replacing with multiple words

I have a string "The quick brown fox jumps over the lazy dog" and i want to replace a few words in the string. Like "The slow red fox climbs over the sleeping dog" I have setup a table called match with 2 fields [pattern], [Replace] with some data. quick slow brown red jumps climbs lazy sleeping How could i use the replace to achieve this? Thanks

Export Multiple Gridviews To Word

Hi, I am trying to export multiple gridviews to Word.  I am able to do this but what i want to do is add some headings and text in between each grivdiew.  Please see my code below i am using to export the gridviews.         Response.Buffer = True        Response.ContentType = "Application/vnd.ms-word"        Response.ContentEncoding = System.Text.Encoding.Default        Response.AddHeader("content-disposition", "attachment;filename=evaluation_report.doc")        EnableViewState = False        Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter        Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)         dv_course_information.RenderControl(oHtmlTextWriter)        gv_gp_practices.RenderControl(oHtmlTextWriter)        gv_attendance_summary.RenderControl(oHtmlTextWriter)        gv_useful_activities.RenderControl(oHtmlTextWriter)         Response.Write(oSt

A tsql report with multiple counts and pivioted description attributes

Hello,   I have an assignment in which I am to prepare a report displayed in excel to return counts of various attributes in the database. However, the count is a bit challenging because it requires counting certain attributes in a pivot format illustrated below. The counts for each category by recruiter, rolled up by Division, within the specified time frame.   The tables that I would have to deal with are as follows:   User: Has the number of Accounts…user accounts with no Recruiter are unassigned Recruiter: Has the recruiter information LoginHistory: Has a record of all logins EForm: Has the various forms, for example: Release and Authorization, Provider Service Agreement EFormUserXref: You can filter it to return the Physican AppForms                                                                       Surgery                                      &n

Need multiple distinct counts, have 1 fact and 1 dimension

I am using SSAS 2005. I have 1 fact table and 1 dimension. I would like to create multiple distinct counts in 1 Measure group, at least I would like them to appear as in 1 measure group to end-user. I have tried role-playing dimensions, and a roll your own approach that work in limitation but didn't scale. Any help and advice would be great.

Parsing multiple "same" xml elements


I have an xml and I need to get the values of all the  <nc:IdentificationID> and <nc:Size>in the < tech:FilingLeadDocument> so I wrote the following code but it keeps giving me the value of very 1st <tech:FilingLeadDocument> for 3 times instead of 3 different < tech:FilingLeadDocument> values .how should I parse its childen to get correct values???


Also how do I get the is id attribute value of < tech:FilingLeadDocument> which is "Lead1" "Lead2" "Lead3" respectively?


<p1:Record  xmlns:p1="http://abct.com/exchange/1.0"


            xsi:schemaLocation="http://abct.com/exchange/1.0  ../xsd/ ExchangeDefinitions.xsd">


<DocketingXML xmlns=" abct.com:schema:xsd:DocketingXML-4.0"



Getting multiple counts ordered by Groups with a TOP X thrown in as well!


Hi, I have a result set (it's from multiple tables), that outputs the following values thus:

Department Statement Rating

IT Factor X 5

IT Factor Y 4

IT Factor X 3

SALES Factor Y 5

IT Factor X 4


Now, what I want to get out of this is a dataset detailing per department which had the highest number of records for a given statement (e.g. factor x) with the avergage.  However I don;t want to output all of them, just the highest.


So, the output would be something like:

Department Top Statement TotalCount  AvgRating

IT Factor X 3 4

SALES Factor Y 

I want to replace the exact words and not a part of word


I have created a table as below
CREATE TABLE [dbo].[EmpDetails](
[Name] [nvarchar](50) NULL,
[Address] [nvarchar](50) NULL,
[Town] [nvarchar](50) NULL,
[City] [nvarchar](50) NULL

I have inserted the value as below
INSERT INTO [Employee].[dbo].[EmpDetails] ([Name],[Address],[Town],[City])

I want the address as
5th Street

So I gave the update query as below
update empdetails
set address= replace(address,town,'')

But what happened was the address got modified as below
5th Street SHIRE.

Now when I give
update empdetails
set address= replace(address,city,''),
now such a word called as ARYSHIRE does not exist.

How do I sort this problem.

I want to replace the word ARY and not ARYSHIRE
This occurs in many parts of my table.

Kindly do let me know.

Programatically Find and Replace the words in Word documents in SP Doc library

The client has uploaded 1000 of MS Word document in SP Document Library.
We have to change some specific text in all documents which we upload in a Sp Document Library.
We have to do this without opening a document.(i.e) we have to do find and replace a text programatically.
Please provide me the solution.
Rajanikanth Rayala

External Data Fields in a Word Template saved as a content type in a document library with multiple


I have created a Word Template for a Document Library that has an External Data Column in it of Client Name which also adds Client Address1, Client Address2, Client City, Client State, & Client Zip.  Now this works fine for a Document library with that template as the Template.dotx file. 

I want to be able to make a bunch of Templates and have them all as Content Types in one Library.  When I do this I cannot get the External Data Quick Parts to work.

Anyone have any ideas?

Obtaining multiple signatures on a protected Word template.


Hello - I asked this question on the Microsoft Word forum but was directed to this one:

Does anyone have experience using the signature feature in a Microsoft Word form template that is protected?  I'd like to be able to obtain multiple signatures while routing the form electronically.  So far I have found that once the first signature is obtained it saves the form in a "read only" format - so it can't go any further to add another signature.

Or, is anyone familiar with the workflow in SharePoint - would I be able to route the form for signatures using SharePoint workflow?

Thank you!

XML Parsing with Xquery returning null records


I've never posted to these forums and I know this is a "common" problem, but I'm struggling big time on it.  


I've recently begun receiving xml files and ran into a small problem that seems syntax related, but I simply can't find where it is.  Below is the xml file and sample code of what I'm doing. I cut up the xml data, it's far more complex then what I'm presenting below.  I think it has something to do what how I'm address eventId but am struggling with figuring it out.  My preference is to stay out of SSIS if at all possible on this project. 

I'm getting rows to return, but they are all null when there is data in the file. 

If you see something with what I'm doing (and replied), I'd be greatly thankful. 

<?xml version="1.0" encoding="UTF-8"?> 
  <pitchMedia eventId="243"> 
    <media type="FLASH" url="xx.html"/> 

Finding words not preceded by other words with MS Word wildcards


Can you help me construct a wildcard search pattern to find a word not preceded by another word to be used in MS Word 2010?

I need to match "likely" in the sentence 1) because it contains the word "likely" but not preceded by the word "not".

1) This is a test sentence containing likely there.

2) This is a test sentence containing not likely there.

Thanks a lot for your suggestions and cooperation!

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET
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