2010-03-04 64 views

回答

5

你可以直接從它的路徑保存圖像(你已經有了)。

試試這個:

byte[] img = File.ReadAllBytes("your image path"); 

    mySqlCommand = "INSERT INTO MyTable(Image) VALUES(@Image)";//mySqlCommand is a SqlCommand, and @Image is a parameter 
    mySqlCommand.Parameters.AddWithValue("@Image", img); 
    mySqlCommand.ExecuteNonQuery(); 
+0

謝謝..這是工作 – user286546 2010-03-17 00:57:01

相關問題