N
ND
hi group,
i just found a strange behaviour with ADO.NET and a MySQL Database (I don't
know if it is caused by the database or the connector):
the following prepared statement didn't work when passing an empty string or
"nothing" to "stringVar"
---
cmdSQL.CommandText = "SELECT count(*) FROM trades WHERE
string_field=@string_field)"
cmdSQL.Parameters.AddWithValue("@string_field", stringVar)
---
....any construct like:
---
if stringVar is nothing then
cmdSQL.Parameters.AddWithValue("@string_field", dbnull.value)
else
cmdSQL.Parameters.AddWithValue("@string_field", stringVar)
end if
i just found a strange behaviour with ADO.NET and a MySQL Database (I don't
know if it is caused by the database or the connector):
the following prepared statement didn't work when passing an empty string or
"nothing" to "stringVar"
---
cmdSQL.CommandText = "SELECT count(*) FROM trades WHERE
string_field=@string_field)"
cmdSQL.Parameters.AddWithValue("@string_field", stringVar)
---
....any construct like:
---
if stringVar is nothing then
cmdSQL.Parameters.AddWithValue("@string_field", dbnull.value)
else
cmdSQL.Parameters.AddWithValue("@string_field", stringVar)
end if