Advertisement
Guest User

Untitled

a guest
Dec 26th, 2020
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public byte[] GetStateDataSlow(long uid)
  2. {
  3. byte[] data = new byte[0];
  4.  
  5. //try
  6. //{
  7. using (SQLiteConnection connect = new SQLiteConnection($"Data Source={_filePath}; Version=3;"))
  8. {
  9. string commandText = $"SELECT * FROM `states` WHERE uid = @uid";
  10.  
  11. SQLiteCommand command = new SQLiteCommand(commandText, connect);
  12. command.Parameters.AddWithValue("@uid", uid);
  13.  
  14. connect.Open();
  15. SQLiteDataReader reader = command.ExecuteReader();
  16.  
  17. foreach (DbDataRecord record in reader)
  18. {
  19. data = (byte[])record["data"];
  20. }
  21.  
  22. connect.Close();
  23. }
  24. //}
  25. //catch
  26. //{
  27. // Debug.LogError("ErrorParceDB");
  28. // return false;
  29. //}
  30.  
  31. return data;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement