Hi
I have a listbox and a textbox corresponding to it.
The listbox is populated from the database.
The user can either type manually in the textbox or click on any value in the listbox. The clicking should place that value in the textbox. To separate different values my code is:
Code:
private void lstExam_SelectedIndexChanged(object sender, System.EventArgs e)
{
String strtmp="";
strtmp += txtExam.Text;
strtmp += Environment.NewLine+lstExam.SelectedItem.Text;
txtExam.Text=strtmp;
}
Once the user clicks on update button, the value of textbox is saved into database. There is also a print button which prints a form pertaining to these values.
Problem:
1)The values fetched from SQL SERVER doesnt contain newlines.
How to identify the newline in SQL Server data ?
2) What if the SQL Server data is to be placed in the textarea and the data should be in different lines appropriately?
Regards,
Vinay