我的數據庫中有一個包含兩列ID和圖像的表。 當我的圖像插入數據庫時,我使用下面的代碼。從數據庫中刪除包含該圖像的記錄後從文件夾中刪除圖像
<pre lang='cs'>
SqlCommand cmd = new SqlCommand("INSERT INTO info(ID,Img_Image) VALUES(@ID,@Img_image));
cmd.Parameters.AddWithValue("@ID", txtID.Text);
cmd.Parameters.AddWithValue("@Image", test_image);
</pre>
... 即test_image從路徑加載圖像即(C:\文件夾)。
現在我的問題是,當我刪除一個特定的記錄...該文件夾中的相應圖像應該被刪除。
P.S .:我使用標準的SQL刪除代碼來刪除記錄。
' test_image'包含路徑或一些圖像數據? – didierc