

In MySQL table the UUID field is varbinary (I hope to see some solution that is not another php link or that is not asking me to switch to char datatype in the database :) ).Įdit: The problem here is we have already added plenty of UUIDs generated by MySQL into the table, so I'm a bit apprehensive about changing MySQL UUID to.
#Sinutrain simulator create gud variable update#
So basically, how can I get the MySQL varbinary field in C# so that I could use that type to update by specifying WHERE in another query?

Here is the UUID field in the same table. MySqlCommand cmd = new MySqlCommand(query, DateTime.Now) NET data type, string, or Guid or byte or anything.īut I need this datatype of s to be used in another WHERE clause in a query like this: string query = session SET logout_time = user_id = AND PK_Id = (_conn.State != ConnectionState.Open) Var s= Convert.ToString(cmd.ExecuteScalar()) //this returns an empty string :( MySqlCommand cmd = new MySqlCommand(query, GetHardwareFingerPrint()) VALUES = SELECT UUID(), (_conn.State != ConnectionState.Open) Here is more of my code: string query = INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint) VALUES = SELECT UUID(), //how to do this here? Something like this, but not exactly: string query = INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint)

As far as I read there is no select_last_insert_id() function for UUIDs!! And I read for php you could assign UUID() function first to a variable and then return that value. VALUES (UUID(), I need this last inserted id back, which is a UUID generated by MySQL. Here is the query: string query = INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint)
