G
Guest
Hi
I want to append DB values to a string.
[code
C
string numbers = ""
if(this.phone1.Text != null
numbers += this.phone1.Text + ","
if(this.phone2.Text != null
numbers += this.phone2.Text + ","
string sql = "Select phone from users where userid = 1 or userid = 2 or userid =3 or userid =
System.Data.DataSet ds = SqlHelper.ExecuteDataset(ConnectionString,System.Data.CommandType.Text,sql)
this.numbers.DataSource = ds.Tables[0].DefaultView
this.numbers.DataTextField = "phone"
this.numbers.DataValueField = "userid"
this.numbers.DataBind()
[/code
How can I append those 4 phone values in users table to string numbers which appended the textbox values?
e.g. numbers = 123456,234567,345678,45678
Or, should I use ArrayList to do it? If so, how to write an arraylist for numbers?
Thanks for help
I want to append DB values to a string.
[code
C
string numbers = ""
if(this.phone1.Text != null
numbers += this.phone1.Text + ","
if(this.phone2.Text != null
numbers += this.phone2.Text + ","
string sql = "Select phone from users where userid = 1 or userid = 2 or userid =3 or userid =
System.Data.DataSet ds = SqlHelper.ExecuteDataset(ConnectionString,System.Data.CommandType.Text,sql)
this.numbers.DataSource = ds.Tables[0].DefaultView
this.numbers.DataTextField = "phone"
this.numbers.DataValueField = "userid"
this.numbers.DataBind()
[/code
How can I append those 4 phone values in users table to string numbers which appended the textbox values?
e.g. numbers = 123456,234567,345678,45678
Or, should I use ArrayList to do it? If so, how to write an arraylist for numbers?
Thanks for help