Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string sql = String.Format("select Peer_guid from State where file_md5 = '{0}'", md5);
- List<string> guids = new List<string>();
- try
- {
- using (SQLiteConnection c = new SQLiteConnection(ConnectionString))
- {
- c.Open();
- using (SQLiteCommand cmd = new SQLiteCommand(sql, c))
- {
- SQLiteDataReader reader = cmd.ExecuteReader();
- while (reader.Read())
- {
- string guid = (string)reader["Peer_guid"];
- guids.Add(guid);
- }
- reader.Close();
- reader.Dispose();
- }
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine("Error ({0}): {1}", ex.Message, ex.StackTrace);
- logFile.WriteErrorLog(ex.ToString());
- return null;
- }
- return guids;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement