I have the following code in a project I’m working on:
foreach(DataTable myTable in myDataSet.Tables)
{
string sSQL = "SELECT `Name` FROM _Columns WHERE `Table` = "'" + myTable.TableName + "'"
MessageBox.Show(sSQL);
}
For some reason, the second apostrophe (‘) is not getting added to the string. In fact, anything I try to append after myTable.TableName, doesn’t get appended. If I replace myTable.TableName with the name of a table, it works! If I use a variable, and set that to a table name, it works too!
Can anyone tell me what I’m doing wrong here?
Thanks for any information!
That won’t even compile, you are ending the string before the first apostrophe.