.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

extracting last four characters of a text column and storing it in a number column

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :SharePoint


is there a way to do the above, for example...I have a text column, Column A containing "172671-08-7892", I need 7892 to be extracted to another column of the type number, from there I need to divide by 2. If the remainder is 0, Column C will be updated as Female, if the remainde is 1, Column C will be updated as Male

View Complete Post

More Related Resource Links

How to tell repeater to wrap text after certain number of characters for a particular column ?

I have a column in my repeater which allows as many as 255 characters and causes the page contents pushed away to the right if any of the record has all 255 characters in that column. How can I tell it to wrap the text after 50 characters ?Thanks,

Storing IP number in a column in db but which column type to use?


I want to store IP number in a column in db but which column type should I use? Of course I can use string but isn't this a waste of storage space? Can I not store IP nr in another type in db that saves space?

Serialization using SQL server or storing a table object as text in a text column



I have a requirement in SQL server 2008 as follows:

I need to Insert into a particular table say Output at runtime where one of the columns (Content) of type text should contain an object of another table (Audit). This is currently being done through C# by serializing the Audit table and updating the Content with the serialized value. But this needs to be done in SQL now as per the requirement.

Can this be done by creating an object of Audit and storing in Output.Content in SQL itself?

Thanks in advance for the help.





Unique text value in databse column


Hi Everyone!

I know this is probably a very basic question but how do I keep a column's text values unique in SQL server (ie for a unique username)?  The column is not an integer it's varchar(50), and it's not the primary key but I could make it the primary key if recommended.

The front end could handle it;  where the user would enter text, it's validated, then a query is done to see if that username is available.  If so, then user can decide to choose it and an insert is done, if not they pick a new username and process repeats.  With this approach, the responsibility of keeping the value unique solely rests on the front end, nothing on the database side.

Is this the correct way to handle this? 

Thank you!


How to show 0 as first number in column


Hi guys. I have two little problem.

I have database with one table and it has 4 rows.

1. I want to show a zero in front of all number. Actually i added but it doesn't show.

2. If i don't put any value in column is it possible to have minus for example instead of 0?




I post it like that because i can't see how to post pics directly.

P.S. The columns with numbers have checked "allow nulls".

I draw in paint so it's not so good but i think it's understandable.

10x in advance.

How to get character count in 'Multiple Text 'column using Calculated Column?


Hi All,

I have a multiple text box in a list

I want

  • A column which lists number of characters in multiple list column example 188, 199 etc
  • Multiple character column must not have more than 200 chars
Is this possible?

Appreciate all the help!


MySqlDataReader - Reading special column characters



I have a MySQL database, which contains columns with danish characters like ø æ and å.

When the MySqlDataReader tries to read this column name:

for (int i = 0; i < MysqlReader.FieldCount; i++)
       string Key = MysqlReader.GetName(i);


The result is not the expected character, but some kind of ASCII value of it. For an example, 'å' gets interpreted as 'Ã¥'.

What to do?

Thanks alot for your help :)

How to read a column of a sharepoint list to a text string field of infopath form?

My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

Most efficient way to check whether a DataGridView contains some specific text at a specific column

Dear All,   I am looking at the most efficient way to check whether a specific column of a DataGridView contains some text. For example I have a list of firs names and I would like to check whether the text "Bob" already exists in that columns. I would like to avoid to loop through each row but what thinking of using something with "Contains".   Anybody has an idea ?   Cheers,   Kalos

SQL Server Unicode Characters in a column

I have an ETL and it fails because of some Unicode Characters. The unicode characters are getting inserted from somewhere in the application and we are still trying to ascertain the source of the same.But till then I need to run a T-SQL Query and find out the rows( I know the column name ) that are causing this problem, modify the data to the correct format and then run the ETL. Would i need to use a cursor? can anyone please advise? It was a bit urgent thus any help would be great! Thanks Nimish

proper format for number column

Hi  In a column i have number datatype but after filling some no it's giving like that 23,786,23 (mostly like a currency format ) but i need like that 2378623 so give me suggestion how i can implement this in sharepoint 2010 , is there need to bound some column level validation for that ............... 

Adding starting text to a column field

I am wanting to know if there is a way you can add starting text within a field that displays within a page layout?  I have a page layout that has a field (column) called 'page summary'. What I want to do is when a content managers creates a new page based on that page layout, the text "This page contains a public notice" is automatically inserted in the page summary field and the content manager can continue typing or highlight the text and remove it. Kind of like adding a base 'Text Value' to the field (column).  I want to be able to do it without having to do custom code though.

[regex] Extracting number preceding a particular text (in this case area unit).

Hi there, I'm looking for a regex to extract two numbers from the same text (they can be run independently, no need to extract them both in one go. I'm using yahoo pipes. Source Text: S$ 5,200 / month Negotiable, 1,475 sqft / 137 sqm (built-in) - Apartment, 10 Anson Road (D02) Need to extract as a number: 1,475 and also (but can be extracted on a separate instance) Need to extract as a number: 137 any guidance will be greatly appreciated. thanks in advance Paco

Lookup column output includes strange characters.

Hi all, I have a lookup column ("Priority"), that returns a number, which it looks-up from a different list (obviously). I have a workflow that emails the user when the list item is created, and in that email I have included the Priority field. However, the email is showing the contents of the Priority field along wth other characters - an example is: The column in the list says 3 The column in the email says 3;#3 What's going on? Why is it adding the additional characters to it? I'm not sure where it's coming from? This only seems to happen where a lookup column contains a number. Thanks in advance. Duncan

How to redirect bad date(xxx,9999) in datereceived column in text file in ssis

I want to redirect bad date format from flate file source to log table. I tried with redirect row but it is not working. Thanks in advance

Wierd case of: Msg 213, Column name or number of supplied values does not match table definition

Hi, I'm working on several triggers (that happen after insert or update) in order to log the changes in a different table. They all follow a similar syntax and are working fine, except for this one... I've reduced the next code to the minimum that gives an error, so we can safely assume the other parts of the trigger are working fine. INSERT INTO [Adt].[WardUnitStayLog] SELECT t.* FROM [Adt].[WardUnitStay] t INNER JOIN inserted i ON i.[Id] = t.[Id]; I've used this same syntax (but on different tables) in other triggers, and these are working perfectly fine. The above query provides the next error: Column name or number of supplied values does not match table definition. I've checked both tables for differences in the columns, but to no avail... (I've checked them manually and by outerjoining the information_schema.columns) (I've also checked the order in wich these columns are defined, they match over the two tables) These are the creation scripts for the tables: CREATE TABLE [Adt].[WardUnitStay] ( [Id] [dbo].[Id] IDENTITY(1,1) NOT NULL, [UnifiedUnitStayId] [dbo].[Id] NOT NULL, [WardCd] [dbo].[Cd] NOT NULL, [_FirstAtTm] [dbo].[Dtm] NOT NULL, [_IsReservation] BIT NOT NULL, [_LastAtTm] [dbo].[Dtm] NOT NULL, [_LastBedCd] [dbo].[Cd] NULL, [_LastPhysicianUid]

Infopath 2007 Repeating Table - Multiple Value Column Text - Hiding Rows based on Column text values

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &
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