1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45:
| using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.OleDb;
namespace ImageRepository { public partial class Form1 : Form {
public Form1() { InitializeComponent();
FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.ShowNewFolderButton = false; dlg.Description = @"Ordnerpfad auswählen"; dlg.RootFolder = Environment.SpecialFolder.MyComputer; if (dlg.ShowDialog() == DialogResult.OK) { } OleDbConnection cnc = new OleDbConnection( @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Sources\ImageRepository\ImageRepository.mdb;Persist Security Info=False;" );
cnc.Open();
OleDbCommand cmd = new OleDbCommand( @"INSERT INTO Images ( Filename, Width, Height, Colordepth ) VALUES ('test.bmp', 32, 32, 24)" ); cmd.Connection = cnc; cmd.ExecuteNonQuery();
return; }
}
} |