EDIT#2
I changed the Title name because it no longer represented the
question I am asking. It turns out my problem was displaying the &
symbol in a c# winforms label.Enter "&" symbol into a text Label in Windows Forms?
That is the answer to the question which turns out is a duplicate
This was the original
I am currently using c# and sql. I have no problem writing to the database, when I check the field using MS SQL Server Manager, I can see the & symbol in the varchar field. but when I retrieve it using c# it seems to be omitted.
myTable.myColumn =" Me & You";
string testString="";
SQLConnection con = new SQLConnection(...)
SQLCommand command=new SQLCommand("Select Top 1 * from myTable",con)
SQLDataReader reader= command.ExecuteQuery()
while (reader.read())
{
testString=reader["myColumn"].ToString();
MessageBox.Show(testString);
}
output = Me You
I wrote this on the fly, it likely is not syntactically correct. Is this normal output or do I likely have a mistake somewhere?
EDIT #1 so it turns out that the MessageBox does display the &. The object this loads into holds the & symbol as well. Even the label that is displaying the symbol holds the & symbol in its .Text property eg. myLabel.Text == “Me & You”. but the display to the screen still says Me you. so the Problem has nothing to do with SQL, but simply to do with Winforms, I will Likely delete this question shortly, unless someone else has experienced this and can offer some insight to speed my troubleshooting
1 Answer