.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

removing multiple characters from a field

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server

I have a column ItemNumber that can have a #, * or ** prior to the item number. I know I can use replace to remove one type of character, but is there a way to strip anytype of special character from the front of the item number?



View Complete Post

More Related Resource Links

How do you create a custom BDC data field that allows for multiple selected values?

I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

Datareader: Set multiple random images into appropriate image field

Hi, first of all, sorry if my title isn confusing as i dont really sure the specify description regarding what i wan to do.   Now what i trying to do is, I getting 5 random images from the database, this is the code for me to get random 5 records from database: Dim command As New SqlCommand("SELECT TOP 5 Description,Image,ImageID FROM Properties ORDER BY ImageID", con)  and with the help of image handler to display it to 5 Images components i put in the page, lets say name it "Image1" to "Image5". Now the question is, how do i assign the 5 diff imageID into the 5 image components? Lets say i wan my Image1's imageID is 1, and Image2's imageID is 2. What im doing now is assigning all the same imageID to all 5 images. Below is how i assign the imageIDDim reader As SqlDataReader reader = command.ExecuteReader If reader.HasRows = True Then While reader.Read Image1.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image2.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image3.ImageUrl = "GetThumbnail.aspx?ImageID=" & reader("ImageID") & " " Image4.ImageUrl = "GetThumbnail.aspx

How to filter a List View by multiple values for one filter field?

Hi, I need to create a dynamically created link to a List View with a filter on one field, but with multiple values. Example: http://<server>/Lists/<list>/Allitems.aspx?FilterField1=Name&FilterValue1=John/Jack/Jonas which should give me all items where Name equals John, Jack or Jonas. Is this even possible?

Combine multiple xml elements into one column field based on subheading


I need to pull down data from a third party vendor's SQL view, where one of the columns is xml. I've never worked with xml before; unfortunately our vendor was not willing to change the format to what they were previously providing.

XML Example:

<ResponseDTO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

Limit number of characters in the view field



I wonder if I can limit number of characters that are being displayed in the view.  For example, one of the columns sometimes has very long description.  I want people to see only 300 characters, and if they want to read more, they have to click on the link to go to details.

Is it possible?

Thank you.

Multiple values in field as parameter


Hello, I want to use values from a field in a sql server table as paramters in my tsql query. The problem is that the data in the field is as follows:

1. There may be only one value, such as '6000'.

2. There may be more than one value, seperated by |, such as '6000'|'6001' This would mean all values that are equal to 6000 or 6001

3. There may be more than one value, seperated by .., such as '6000'..'7000' This would mean all values that are from 6000 through 7000

Any help is appreciated. Thank you.


Custom Form Field in Collect Data Action doesnot capture multiple users.


I have a situation where the department head dynamically assigns the reviewers depending on the document that is uploaded. To capture the reviewers I added a Collect Data Action and a "Reviewers" form field, with type "Person/Group" and checked the following properties

1. Allow selection od People and Groups, 2. Choose from all users and more importantly 3. Allow multiple users

Although I am able to enter multiple users in the form, I am able to retrieve only the first user I entered and the rest just.. disappear!

Lookup field which allows multiple choice - problem when query with CAML


I created one simple list and added one column - lookup - I've chosen some source list and field, then marked "Allow multiple choice". I created new item in that list, by adding more than one valie to that coulm.

The problem is, when I use CAML query, that column has such values:


and it's suppose to be like this:


do You have any idea, why it doesn't query first ID?

Restricting field value to one of two characters


When editing a data record from a detailsview, i need the input to be either a Y or N. I tried using a comparevalidator, but it allows only one character in which the value must be equal to. Ideas? 

ASP.NET sends a single character instead of multiple characters to SQL


Hello there,

I've been working on this very simple problem for days. I really don't know what's wrong. I have an insert statement that saves the Category Code, Call Number, and other details of a book to an SQL Server Database. The code is found below. The bold font is the one having the problem.

neither the code, nor the stored procedure has an error. The only problem I have is that the Category Code of "CHM" for instance, is reduced to a single character "C". The same thing happens with all other category codes that were inserted. Only the first character is saved. This is odd, because the Call Number, which has the same data type and string length, does not suffer the problem. It is saved with an intact 3 number of characters in the database. I left a breakpoint on the part that captures the content of the string variable CategoryCode, and it clearly contains a total of 3 characters. I also executed the stored procedure directly in the database, and it's also saving 3 characters. However, when ASP.NET connects to the database using that stored procedure, it always save a single character for category code.

I really don't know why this is happening. I am really hoping that you could help me. :(

Thank you so much in advance.

How to improve the performance of multiple selection field in Infopath 2010 ?


Hi Infopath experts

I am developing an infopath form that has 4 big multiple selection fields (each field has more than 50 choices). Each time the users select a choice from the muiti-selection field, the form takes a lot of time to response. This only happened with IEs (I am using IE8 now). When I tried it with other browsers (firefox, chrome, safari), the performance increased drastically.

I have seen other people saying that IE has issues with Infopath and IE9 might solve the issues. However, our company won't upgrade to IE9 anytime soon. If anyone has workarounds for this issue, please help me with it

Thank you,



This field can have no more than 255 characters error - mutiple values


I have a doc lib.
I have a list i used to store categories.
Then i have a lookup from my doc lib that uses this category colum and i nade it multiple values.
When users try to upload ths docs and add mutiple records using the multiple values they get the error.

This field can have no more than 255 characters.
Any ideas on how i can fix this?

Thanks in Advance

Resolve AD names to Display names in SharepointDesigner Workflow emails for multiple user field



Is there a way I can resolve multiple users in a "People and Group" field to thier display name rather than Ad name in sharepoint when doing a designer workflow . The workflows job is send the mail to the business owners and request request that a certain permission be granted to User A, UserB, User C,...and so on.

SPD activities Linktitle action to my understanding only resolves a single user.





How to set multiple value for a lookup field with powershell script?


I have a list that has a lookup column and can have multiple values.  I know how to set value to this field with powershell script. I need to know how to set multiple values to this field. 

Also, how can I create this field with powershell script?

Thanks and regards,


escaping characters in calculated field.


I am trying to use a calculated field to parse another field in a custom list. I basically need to make another field that is Regex safe. So i need to parse the text and look for (\ , - , ( , ) , [ , . , ], +, $, ^) then add a '\' in front of them. I used excel to make a solution but i can only go 7 or 8 nested SUBSTITUTE deep(or so im told) and you apparently cant use substitute in SP2010.

i tried something like this:

IF(ISERROR(SEARCH(")",[Message])),,REPLACE([Message], SEARCH(")", [Message]), 1, "\)"))

This works. but I need to string 10 more behind it to include the other characters. Any ideas?

How to archieve the field template that can update or insert multiple field value in database table,



How to archieve the field template that can update or insert multiple field value in database table,please? 

Data returned from 1 field includes multiple answers!!


Hi, I have a database field that stores multiple letters and numbers separated by ,

An example of this: o,t,g,h,w,x,q,l,m,b,c,5,r,

Each letter or number can be referenced to another table in the database which includes an explanation of what each letter or number actually means! The trouble I have is that I do not know where to start in order to display the correct results.

Can anyone help with some code to kickstart me in the right direction? I have the code below and this allows me to display the data from the field.

<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource9" Height="50px" Width="125px" onpageindexchanging="DetailsView1_PageIndexChanging"></asp:DetailsView>

<asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [field8] FROM [datafeed$] WHERE ([field1] = @field1)">

<SelectParameters><asp:ControlParameter ControlID="DropDownList4" Name="field1" PropertyName="SelectedValue" Type="String" /></SelectParameters></asp:SqlDataSource>

From the above example code each letter and

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