Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. mySQLConnection iConn = new mySQLConnection(); /*Ceate and open connection*/
  2. String insertQuery = "INSERT INTO computer_screen(filecontent) VALUES(@filecontent)";
  3. MySqlCommand command = new MySqlCommand(insertQuery, iConn.mcon);
  4.  
  5. command.Parameters["@filecontent"].Value = File.ReadAllBytes(@"C:\err_0422_114255.jpg");
  6. command.ExecuteNonQuery();
  7.  
  8. CREATE TABLE `computer_screen` (
  9. `id` int AUTO_INCREMENT NOT NULL,
  10. `filecontent` blob,
  11. /* Keys */
  12. PRIMARY KEY (`id`)
  13. ) ENGINE = MyISAM;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement