.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

Loop until a string match is found

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Hi,I have a column in a table which contains a string of data (about 2000 characters in length). this particular column data may have multiple occurances of an Order number. I will have to find out each one of these and insert them as a separate row in another table. I'm not quite sure how to approach this.To make it clear, here's an example:Table_A has column called data_col.data_col has data :********TOP OF DATA***********some text Order# 1111111 some textsome text Order# 2222222 some textsome text Order# 3333333 some textsome more text********BOTTOM OF DATA***********each of these rows will have the header and footer called top of data & bottom of data. So , I was thinking of something like looping through until we hit "Bottom of Data", and get the 3 order#s into a separate tablebut I'm not sure how.Let me know if the question is not clear enough.Thanks

View Complete Post

More Related Resource Links

"The member was not found when the string was parsed - SSAS 2008/PivotTable



    I have defined an Additional Action to show me some detailed records when I'm using a PivotTable against an SSAS 2008 cube.  However, the problem is intermittent.  It seems to be complaining about a datetime field - yet this datetime field isn't even being requested as one of the drillthrough columns. 

    The full message is "Query (187,1319) The member '&[2010-07-30T15:31:44:263333] was not found in the cube when the string [Final Criminal Count Charge].[Load Datetime].[All].&[2010-07-30T15:31:44.263333], was parsed."

   Any assistance would be gratefully accepted!!


No Exact Match Found for only one user



        i cannot find a new user who has been added to the active directory recently in the people picker. when searched for other users it works.

it is saying no exact match found for this new user.

we did profile sycn, still doesnt show up. we also did the following

a. stsadm.exe -o setapppassword -password <somekey> - this command is use as encrypt\decrypt key
B.  stsadm.exe –o setproperty –pn peoplepicker-searchadforests –pv <list of forests or domains> -url <webapp> - this command is use to set the property for a specific web application.

 still doesnt work.


any workarounds? i would appreciate your help

Trying to prevent a match if string contains X

I'm relatively new to RegEx and trying to wrap my head around the whole thing. I'm sure others would need to accomplish what I'm trying, but I can't seem to use the right search terms to find anything.

I'm using a RegEx to either Match or Not Match if the string contains certain words/characters.

Example1:  "Do Not Match" vs "Match"

I want to match each string on the word Match. However, since the first string contains "Do Not" I don't want to match on it at all.

Example2:  "Some Example [Text]" vs "Some Example Text"

Since the first string contains [] I do not want a match at all.

Hopefully I've got my point across. I've tried numerous things and all have failed. Conditionals, LookAheads, LookBehinds, etc. I don't know enough to make this thing work the way I want. I will appreciate any assistance.


How to convert DataTable objects to IList without using For Each Loop


DataTable result = GetDataSetByQuery(query).Tables[0]
IList<string> li=new IList<string>();

Can we implement through LINQ ?

UriTemplate won't match string parameters with slashes


Hello All,

I have a WCF service that takes string parameters in the UriTemplate which contain slashes. For example, I want to setup a UriTemplate like "/items/{itemId}/elements", where the itemId contains slashes.

I tried to use the wildcard, like  "/items/{*itemId}/elements, but using this template chokes the runtime. I learned from this link that it appears to work only when the wildcard appears in last variable is the segment.

I could remove the offending variable (in this case, itemId) from the Uri and add it to the body of the request, but I woul like to avoid it since it would result URLs not very intuitive.

Any help would be greatly appreciated.

Kind regards





How do I match and not capture something in brackets in the middle of a string that I am capturing?


This is my input string:

, a. [the Cat.] Pertaining to the Cat.


This is my regular expression:


(?!^|,) means match the beginning of the string or a comma, negative lookahead

([\s,\S]*?) means match anything

[A-Z] means match a capital letter-- in this case, it was meant to capture 'P' from "Pertaining to..."


This is what I catch:

a. [the


This is what I want to catch:



Some input strings, like the one above, have [some text in brackets] while some input strings do NOT.

If there is bracketed text in the string with a capital letter,

1) how do I prevent the capital letter in the brackets from matching the [A-Z], and

2) how do I not capture the bracketed text?


Thanks for the help!

Regular Expression Match Exact String


I'm looking for a regular expression that satisfies one of the two conditions (Reg Expression OR Exact String Match W/ Underscores) listed below.





Thanks in advance

How do I prevent the largest possible match on a string?


Here's the string

(X) </a><b>string1</b>, <a href="testing 1-2-3">string2</a> (string3)

Here's my regular expression:


which i think means:

\(  match an open parenthesis

([\s,\S]{2,}?)   match any space or non-space characters at least two long (inside parenthesis)

\)  match a close parenthesis


I thought specifying {2,} would prevent (X) from being matched, but the problem is, my regular expression matches the open parenthesis starting at the beginning of the string (X) and ending with (string3). 

All I want to capture is (string3)

How can I accomplish this?


does static Regex.Match(string input, string pattern, RegexOptions ops) cache ?


in msdn, it is said that static Regex.Match(string input, string pattern) caches for future uses,

but it doesn't say whether static Regex.Match(string input, string pattern, RegexOptions ops) caches.

Then does it cache? Does it help to promote performance at creation?


Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

Built-in Functions - String Functions

String functions let you extract various portions of character strings, change the case of strings, concatenate and reverse strings and perform many other types of manipulations. All built-in string functions are deterministic with the exception of CHARINDEX and PATINDEX

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Handling 404 page not found with Error page



      How do i handle 404 page not found?

highlight string


i am looking for a function that takes two string parameters 

str1 = "hello how are you today mr john"

str2 = "how today"

and in return it shoud highlight the words "how" and "today".

Any ides? I prefer if its possible using reg expression...Thanks

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