BUF具有數據類型VARBINARY(最大)值的值並且該值是0x0000002D數據表不接受VARBINARY
string buF =
"0x" + BitConverter.ToString((byte[])dt.Rows[i]["BuF"]).Replace("-", "");
Label3.Text = buF;
我使用的值來找到FILEID
DataTable dt = new DataTable();
SqlConnection connection = new SqlConnection();
connection.ConnectionString = ConfigurationManager.ConnectionStrings["XYZ"].ConnectionString;
connection.Open();
SqlCommand sqlCmd = new SqlCommand("SELECT FileID FROM Backed where MachineID = @machineID AND BuF [email protected]", connection);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
sqlCmd.Parameters.AddWithValue("machineID", strID);
sqlCmd.Parameters.AddWithValue("buF", buF);
sqlDa.Fill(dt);
connection.Close();
I不使用buf的值,我沒有得到正確的filid ....
但是,如果我使用這與value0x0000002D而不是buf我得到的文件ID ...爲什麼發生這種情況...我嘗試了一切,但沒有 似乎工作
我需要幫助