| Author |
Topic |
|
nickjack
Starting Member
34 Posts |
Posted - 2008-11-12 : 00:03:15
|
| I have a multiline text box in which admin can enter value.what i need the value in text box will save in database in format likeID Option1 Poor2 Good3 Average4 SatisfactoryNote:The Value in Textbox will be in any Format mean it will likePoor,Good,Average,SatisfactoryorPoorGoodAverageSatisfactory |
|
|
cvraghu
Posting Yak Master
187 Posts |
Posted - 2008-11-12 : 00:10:09
|
| The existing design would not allow you to decide the delimiters. There could be multiple ways in which user can enter data. You can design something along this line - have dual list box and make the user choose these options on one and add it to other. You can loop through these chosen options either in UI or backend and add the data to table. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
nickjack
Starting Member
34 Posts |
Posted - 2008-11-12 : 02:07:43
|
| i have use only '\n' and ',' and ' 'and insert value in Database? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-12 : 02:26:05
|
quote: Originally posted by nickjack i have use only '\n' and ',' and ' 'and insert value in Database?
that will make manipulation complex. try to make delimiter consistent. Otherwise you've write code to identify correct delimiter each time and then split values based on that. |
 |
|
|
nickjack
Starting Member
34 Posts |
Posted - 2008-11-12 : 02:45:03
|
| Hi, Being new to Sql it's hard for me to Understand i am writing again what i need isI have a Textbox(Multiline) where admin enter value in any format likepoor,poor,poor,pooror in a format likepoorpoorpoorpoorwhat i need is when value is inserted in Database will done in new row? (I have created Db)ID Options1 poor2 poor3 poor4 poorAny Sample Code |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-12 : 03:34:55
|
| i have given you solution for this. But i was just telling it would be better if you can enforce a consistent delimiter (either ',' or '/n') for entered values. |
 |
|
|
nickjack
Starting Member
34 Posts |
Posted - 2008-11-12 : 04:53:32
|
| string[] str; if (TextBox1.Text.IndexOf(",") > 0) { str = TextBox1.Text.Split('\n'); } else { str = TextBox1.Text.Split(','); } foreach (string s in str) { i am writing insert command here }But the Problem is Value still save in Single column like [(A,A) or (A A)]Plz modify it? |
 |
|
|
|