.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

Manipulate (do a substring on) a Posted By:      Posted Date: August 26, 2010    Points: 0   Category :SharePoint



I've got an application where I'm setting a cust list field description to a string... Here is _____ text.  This displays in a form as <SharePoint:FieldDescription.... .

I'd like to display this on a form as Here is [text input box] text.  i'd been hoping to do this with a substring-before and substring-after function call...unfortunately it doesn't like the <SharePoint:FieldDescription in an attribute.

Anyone else have any ideas how to manipulate this?  Can't seem to find documentation on these...the <SharePoint:CalculatedField looks interesting....

Thanks in advance for any replies...


View Complete Post

More Related Resource Links

Easily manipulate data with the GridView control in ASP.NET 2.0

Last week, I introduced ASP.NET 2.0's GridView data control and covered the basics of using it. This week, I go a step further by going into the details of working with the data contained in the control. This includes viewing, editing, and deleting data. Thankfully, the GridView control makes it easy to utilize these features. Before diving into these topics, I begin with an examination of the different field types supported by the GridView control.

Security: Manipulate Privileges in Managed Code Reliably, Securely, and Efficiently


When the author was faced with implementing support for changing a security descriptor on an object, he noticed there was not support for that operation in .NET. So he devised two solutions to the problem: the first, simpler one, is tailored to the .NET Framework 1.1 and can be used today. The second solution incorporates several advanced features available only in the .NET Framework 2.0. Both are presented here.

Mark Novak

MSDN Magazine March 2005

Real-World XML: Manipulate XML Data Easily with the XPath and XSLT APIs in the .NET Framework


XPath is emerging as a universal query language. With XPath, you can identify and process a group of related nodes in XML-based data sources. XPath provides an infrastructure that is integral to XML support in the .NET Framework. The XPath navigation model is even used under the hood of the XSLT processor. In this article, the author reviews the implementation details of the XPath navigator and the XSLT processor and includes practical examples such as asynchronous transformations, sorted node-sets, and ASP.NET server-side transformations.

Dino Esposito

MSDN Magazine July 2003

Real-World XML: Manipulate XML Data Easily with Integrated Readers and Writers in the .NET Framework


In the .NET Framework, XmlTextReader and XmlTextWriter provide for XML-driven reading and writing operations. In this article, the author discusses the architecture of readers and how they relate to XMLDOM and SAX parsers. He also shows how to use readers to parse and validate XML documents, how to leverage writers to create well-formed documents, and how to optimize the processing of large XML documents using functions to read and write Base64 and BinHex-encoded text. He then reviews how to implement a stream-based read/write parser that combines the functions of a reader and a writer into a single class.

Dino Esposito

MSDN Magazine May 2003

Graphics: Manipulate Digital Images in Internet Explorer with the DirectX Transform SDK


The Microsoft DirectX Transform is a Microsoft DirectX media API that can be used to create animated effects as well as to create and edit digital images for Windows-based applications. Scripting and HTML can be used to display an existing transform on a Web page, and improved transform support in Microsoft Internet Explorer 5.5 makes it easy to use transforms. This article provides step-by-step instructions for writing a transform as an ATL project and shows an example of an image transform. C++ is used to instantiate, configure, and display transforms in this project.

Alex Lerner

MSDN Magazine March 2001

How can I allow user to manipulate an image behind another image?



I am working on an administration web page for an iPhone application that will allow users to upload their logo.   The page will have an image of the iPhone app with a transparent space where their logo would go.  I would like the users to be able to manipulate their logo by dragging it and resizing it into the space on the iPhone app template.

Does anyone have a good approach for this?

I have tried the AJAX ResizableControlExtender, but I can't get it to work behind the template image.  Once I add a position:absolute attribute, the resize control no longer works.

I can make buttons that adjust the top, left, width, and height properties via javascript, but that isn't as user friendly as being able to drag and resize the image with the mouse.

Does Silverlight have a good solution for this?

Any ideas are welcome.

Thank you!


Creating Code Function or Assemblies to manipulate Dataset

Folks In SSRS the dataset, can it be send to a Code function for further manipulation of the data ? For example, In SSRS I have a Column of Data and I want to passed it to a Code Function, and the code function for certain values and perform some Engineering calculation, and the function than return a modififed dataset. Can I do this ? Thanks in Advance  

How to find a rownumber in a matrix in SSRS and use it to manipulate data

Hi, I have an MDX query which returns me a dataset. It is something like this. Country Measure 1 Measure 2 Country 1 99 100 City 1 45 50 City 2 40 30 City3 14 20 Now in the actual report I need to show the data for the City Rows using a logic like City.Measure - Country.Measure. This has to be dynamic as I dont know the number of rows in my report. I have taken a tablix and bound my cells to the appropriate measures. My problem is to write an expression for the cell such that if it is the 1st row (Country row), then it should directly take the value, else it should do a logic like City.Value- Country.Value (in ex. for City 1, Measure 1 data should be -44 ). Can someone help me in writing the expression. I checked on net and saw that we can use the RowNumber function, but I could not use it like =iif(Rownumber=1, "1st Condition", "2nd Condition"). Any help will be appreciated. Thanks, Suman


Hi All, We are having string in the format of:- 'Xyz, Abc P.' 'Pqr, Lmn Q.' We need to split the the string and store into three different columns Expected O/p:- FirstName LastName MiddleName Xyz Abc P Pqr Lmn Q Thanks Regards, Kumar

Apply substring to date field

I have a gridview that has a field called TargetDate which is formatted as dd/mm/yyyy.  I want to substring the numbers out of the date.  So basically remove the '/'.  How do I do that?  I can't just substring(0,2) because sometimes the date is single digits, sometimes 2 digits.  I am using vb.net.   thanks  

using substring


in asp.net i get a string frm database in  a variable

frm that i need to check for a substring which exixst in another variable ,

the length of string substring  is not knwn

eg var1="hello.howr u.what"


var2 is a substring of var1 .

how do i check



Manipulate a dataset in a Gauge


I have a dataset based on a stored procedure that is returning ID, Amount, Category, SubCategory, PayType.  I am using this same dataset for about 5 other gauges on the same page by using filters on the gauge to categorize and sum up amounts for me based on Category and SubCategory.  I have one gauge that I want to use this same dataset for, however in this case I want to basically filter by Category X and then subtract the Sum(PayType1) from Sum(PayType2).  I realize the below formula doesn't work, but an example of what I wanted is sort of:

=SUM(IIF(Fields!PayType.Value, "Dataset")="Pledge", Fields!Amount.Value, Fields!Amount.Value*-1.0)

So I want to subtract all the 'payment' PayTypes from the 'pledge' PayTypes.  Is there a way to do this with the dataset I have already called?

I realize that I can create another dataset and do the calculations there and have it returned, and this may even be the better way.  I just wasnt sure if it took less resources to just filter the dataset I already have returned, or to hit the server with another stored procedure call.

Any thoughts?

SQL Server 2008R2


Thank you.

How to manipulate both envelpe and body of soap message


Can you please help to manipulate the both envelope and body of SOAP message. I am using MessageInspector and in the BeforeSendRequest method,  i have a request like that.

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
    <a:Action s:mustUnderstand="1">http://www.aaaa.com/IServices/Method</a:Action>
    <Method xmlns="http://www.aaaa.com">
After manipulation i want to create a Message wwhic will have following XML:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12">
		<a:Action s:mustUnderstand="1">http://www.aaaa.com/IServices/Method</a:Action>

patindex using in substring




PATINDEX('%HP D%',Substring(e.ErrorString,Charindex

Substring not working as expected in UDF


Apologies if this is very simple and part of the basic SQL training but i'm very new to User Defined Functions (SQL 2000)

I am trying to create a function to take two variables, a varchar financial year value and an nvarchar financial month value and convert this to a datetime format, with the date automatcially being the 1st of that month.

Example: Take '2010/2011' and 2 (2nd financial month) as variables and convert to 2010-05-01 00:00:00.000

The function i am trying to create is below and i know that the code inside the function works fine, as i've tested it. The problem seems to be that the substring function is not working as it should be within the udf i am trying to create. instead of returning 4 characters, its only returning 1. Is this a known issue with UDF, and if so, is there anyway around this?


CREATE FUNCTION FinYrDate (@FinYr varchar, @FinYr_Mnth nvarchar)
RETURNS datetime

DECLARE @ReturnedDate datetime

SET @ReturnedDate =
WHEN @FinYr_Mnth < 4 THEN convert(datetime,(cast((@FinYr_Mnth + 3) as varchar) + '-1-' + SUBSTRING(@FinYr,1,4)))
WHEN @FinYr_Mnth between 4 and 9 THEN convert(datetime,(cast((@FinYr_Mnth + 3) as varchar) + '-1-' + SUBSTRING(@FinYr,6,4)))
ELSE convert

need proper substring


Table 1

col1 varchar(20)





I want to select currency after first 5 digits ,I know we can write select statement like this

select substring(col1,6,20) as currency from table 1

but I want some code which seperate currency directly only .If you know please let e know.Thanks



Better performance for manipulate DataTable



I want to know if it is recommended to use LINQ to objects for do something for each row in a DataTable, or it gets me bad performance comparison to do simple for-each loop  on DataTable's rows. I love use LINQ because it is nicer code, but I don't want get bad performance.

In simple words, what is the more recommended code:

1. Use simple ForEach loop



(DataRow row in myDataTable.Rows)

row[1] =


2. Use LINQ foreach

myDataTable.AsEnumerable().ToList().ForEach(row => row[1] =

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