(17-02-18, 11:10 AM)khodor1985 كتب : تفضل أخي العزيز، لقد تم التعديل على المشروع بناء لطلبك
المشروع بعد التعديل عليه :
ممكن سؤال شنو تقصد برقم 2 او 1 في داتا بيس هل هي اسماء الحقول + كم حقل اضيف في داتا بيس غير ImageName , ImagePath
واسف كثير منك لأنك اتعتبك معي
اخي الكود التالي عملته هو اضافة من الصورة المسار والاسم وتمت العملية ب نجاح عن طريق التعديل ب براميتر
Try
Using conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\employeedb.mdb;Jet OLEDBatabase Password=1234kk")
conn.Open()
Dim command As New OleDbCommand("insert into employees (first_name, last_name, initial, address, age, contact, status, department, gender, e_position, date_hired, end_contract, rate, tin, sss, bday, kat3, mnsb, fr3, a1, a2, a3, a4, ImagePath, ImageName) values (@fname, @lname, @initial, @address, @age, @contact, @contractualradio, @dept, @gender, @pos2, @date1, @date2, @rate, @tin, @sss, @bday, @kat3, @mnsb, @fr3, @a1, @a2, @a3, @a4, @txtImagePath ,@txtImageName)", conn)
With command.Parameters
.AddWithValue("@fname", fname.Text)
.AddWithValue("@lname", lname.Text)
.AddWithValue("@initial", initial.Text)
.AddWithValue("@address", address.Text)
.AddWithValue("@age", age.Text)
.AddWithValue("@contact", contact.Text)
.AddWithValue("@contractualradio", contractualradio.Text)
.AddWithValue("@dept", dept.Text)
.AddWithValue("@gender", gender.Text)
.AddWithValue("@pos2", pos2.Text)
.AddWithValue("@date1", date1.Text)
.AddWithValue("@date2", date2.Text)
.AddWithValue("@rate", rate.Text)
.AddWithValue("@tin", tin.Text)
.AddWithValue("@sss", sss.Text)
.AddWithValue("@bday", bday.Text)
.AddWithValue("@kat3", kat3.Text)
.AddWithValue("@mnsb", mnsb.Text)
.AddWithValue("@fr3", fr3.Text)
.AddWithValue("@a1", a1.Text)
.AddWithValue("@a2", a2.Text)
.AddWithValue("@a3", a3.Text)
.AddWithValue("@a4", a4.Text)
.AddWithValue("txtImageName", txtImageName.Text)
.AddWithValue("txtImagePath", txtImagePath.Text)
End With
لكن العرض سبب لي مشكلة لا اعرف كيف يتم عرض الصورة استخدمت الدوال السابقه ولم افلح
علما ان باقي الحقول مطلوبة ب اضافة ان رقم الصف للمسار هو 29 و للاسم هو
الدوال findimage و loadimage لم تنفع معي وكذلك save image لكنني استطعت ان احفظ اسم الصورة ومسارها
كود :
Try
Using conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\employeedb.mdb;Jet OLEDBBig Grinatabase Password=1234kk")
conn.Open()
Dim command As New OleDbCommand("insert into employees (first_name, last_name, initial, address, age, contact, status, department, gender, e_position, date_hired, end_contract, rate, tin, sss, bday, kat3, mnsb, fr3, a1, a2, a3, a4, ImagePath, ImageName) values (@fname, @lname, @initial, @address, @age, @contact, @contractualradio, @dept, @gender, @pos2, @date1, @date2, @rate, @tin, @sss, @bday, @kat3, @mnsb, @fr3, @a1, @a2, @a3, @a4, @txtImagePath ,@txtImageName)", conn)
With command.Parameters
.AddWithValue("@fname", fname.Text)
.AddWithValue("@lname", lname.Text)
.AddWithValue("@initial", initial.Text)
.AddWithValue("@address", address.Text)
.AddWithValue("@age", age.Text)
.AddWithValue("@contact", contact.Text)
.AddWithValue("@contractualradio", contractualradio.Text)
.AddWithValue("@dept", dept.Text)
.AddWithValue("@gender", gender.Text)
.AddWithValue("@pos2", pos2.Text)
.AddWithValue("@date1", date1.Text)
.AddWithValue("@date2", date2.Text)
.AddWithValue("@rate", rate.Text)
.AddWithValue("@tin", tin.Text)
.AddWithValue("@sss", sss.Text)
.AddWithValue("@bday", bday.Text)
.AddWithValue("@kat3", kat3.Text)
.AddWithValue("@mnsb", mnsb.Text)
.AddWithValue("@fr3", fr3.Text)
.AddWithValue("@a1", a1.Text)
.AddWithValue("@a2", a2.Text)
.AddWithValue("@a3", a3.Text)
.AddWithValue("@a4", a4.Text)
.AddWithValue("txtImageName", txtImageName.Text)
.AddWithValue("txtImagePath", txtImagePath.Text)
End With