Click here to Skip to main content
13,190,404 members (52,510 online)
Rate this:
Please Sign up or sign in to vote.
See more:
cmd.Parameters.AddWithValue("@Account_No", txtaccount1.Text + "-" + txtaccount2.Text);

Here I am inserting data in a column from different text boxes, how to retrieve same data from database in different text boxes ????
Posted 22-Nov-12 5:58am
Updated 22-Nov-12 6:10am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try using String.Split Method[^].
This method will give you incorrect results if the text in either of the text-boxes have a "-" character. So its better to store the values of both the textbox in separate columns in the database.
Sk. Tajbir 22-Nov-12 12:22pm
nice link.. 5+
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Split String
    string str;
    str = "Ali-Asadi-...";
         string[] master;
           master = str.Split((char)45);//45 Key ASCII - 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171016.2 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100