这是我的代码:
string strSQL = "SELECT * from tMedia where SKU = '" + SKU + "'";
FbCommand command = new FbCommand(strSQL, databaseConn);
if (databaseConn.State == ConnectionState.Closed)
databaseConn.Open();
FbDataReader data = command.ExecuteReader();
data.Read(); // only one row is returned
// assignment to "x" is empty (277?)
string x = (string)data["ProductType"].ToString();
// find product type and set flag for later testing
// obviously, these don't work either!
if (data["ProductType"].ToString().Contains("Video "))
videoFormat = true;
else if (data["ProductType"].ToString().Contains("Music: "))
audioFormat = true;
// coProductType.Text assignment is correct
coProductType.Text = data["ProductType"].ToString();