Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
friends i am working for a web application..in that i get the data from database i need to split the data and assign to different textboxes...
Posted
Comments
Maciej Los 24-Jul-15 1:54am    
What have you tried? Where are you stuck?
Thanks7872 24-Jul-15 2:07am    
Do you have any question?

I'd suggest to start with basics:
How to: Split Strings (C# Programming Guide)[^]
 
Share this answer
 
Comments
User-11630313 24-Jul-15 2:04am    
thankyou.....Mr Maciej Los please can you tell me how to assign split data to textboxs
Sanket Saxena 24-Jul-15 2:09am    
see the link shared by Maciej...inside foreach loop you need to assign splitted values to the textboxes as per your requirement
Wendelius 24-Jul-15 2:09am    
Or split it already when querying. 5'd.

But I sure hope it's not because of storing separate data inside a single column :)
Maciej Los 24-Jul-15 2:12am    
You're right Mika, another option is to split data on sql server side.
Thank you, Mika.
Just based on the question you have wrote, it sounds like you store multiple data items inside a single column. This causes a situation that when you fetch the data you need to split the data in order to be correctly shown or manipulated.

So it all comes back to design. Using a single column for multiple data items is a choice you will most likely regret later. It introduces unnecessary complexity, like:

  • how to split the data when fetched
  • how to concatenate data
  • how to query the data partially and so on...

So instead of using a single column, if the amount of data items is fixed and they are known, you can use multiple columns. If the amount of items is unknown or you need to add descriptive information to them, use a separate table for the data having a foreign key to this, parent table.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900