27-02-13, 03:40 PM
Easy 4ever كتب :عفوا أخي نوع الحقل ليس Binary> من الفصله ههههههه
جرب Longblob
=========================
الكود التالي يقوم بتحويل الصوره إلى Binary ويضيفها
كود :
[align=left][SIZE=4]Dim AddPicture As New OleDb.OleDbCommand("insert into [b][color=#008000]T1 [/color][/b]([b][color=#008000]Pic[/color][/b]) values (?)", con)[/SIZE]
[SIZE=4]
Dim p() As Byte = My.Computer.FileSystem.ReadAllBytes([b][color=#800000]PathFile[/color][/b])[/SIZE]
[SIZE=4]
AddPicture.Parameters.AddWithValue("@[b][color=#008000]Pic[/color][/b]", OleDb.OleDbType.Binary).Value = p[/SIZE]
[SIZE=4]
[/SIZE]
[SIZE=4]con.Open()
[/SIZE]
[SIZE=4]AddPicture.ExecuteNonQuery()
[/SIZE]
[SIZE=4]con.Close()[/SIZE][/align]
* ملاحظة T1 هو اسم الجدول و Pic اسم الحقل و PathFile متغير فيه مسار الصورة
طيب اخي في الكود امر انه يسحب الصورة من الجهاز .. طيب انا ابغى الصورة من البرنامج يعني تكون في فورم البرنامج يحفظها من البرنامج


