Reklaw
asked on
MySQL - VB.NET - MD5
I'm sure this is going to be an "it's easy when you know how..." but here goes.
If I run this on a MySQL command line I get what I expect:
mysql> SELECT MD5('test text') AS strMD5;
+------------------------- ---------+
| strMD5 |
+------------------------- ---------+
| 1e2db57dd6527ad4f8f281ab02 8d2c70 |
+------------------------- ---------+
1 row in set (0.00 sec)
However if I do this:
strSQL = "SELECT MD5('test text') AS strMD5"
objSQLCommand.CommandText = strSQL
objDataAdapter = New MySqlDataAdapter()
objDataAdapter.SelectComma nd = objSQLCommand
objDataSet = New DataSet
objDataSet.DataSetName = "xxxx"
objDataAdapter.Fill(objDat aSet, "yyyy")
objDataSet.WriteXml(Respon se.OutputS tream)
I get:
<xxxx>
<yyyy>
<strMD5>MWUyZGI1N2RkNjUyN2 FkNGY4ZjI4 MWFiMDI4ZD JjNzA=</st rMD5>
</yyyy>
</xxxx>
Why is the result different?
Mike
If I run this on a MySQL command line I get what I expect:
mysql> SELECT MD5('test text') AS strMD5;
+-------------------------
| strMD5 |
+-------------------------
| 1e2db57dd6527ad4f8f281ab02
+-------------------------
1 row in set (0.00 sec)
However if I do this:
strSQL = "SELECT MD5('test text') AS strMD5"
objSQLCommand.CommandText = strSQL
objDataAdapter = New MySqlDataAdapter()
objDataAdapter.SelectComma
objDataSet = New DataSet
objDataSet.DataSetName = "xxxx"
objDataAdapter.Fill(objDat
objDataSet.WriteXml(Respon
I get:
<xxxx>
<yyyy>
<strMD5>MWUyZGI1N2RkNjUyN2
</yyyy>
</xxxx>
Why is the result different?
Mike
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Many thanks to you both
Mike