الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ممكن حل مشكله فى اضافه صنف

مغلق
بدأه abo_shroook في 13 فبراير 2008 · 3 رد · 626 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

احبائى اعضاء المنتدى الكرام

عند اضافه صنف تظهر العباره التاليه

number of query valuse and destiontion fields are the sane

وهذا هو الكود

Dim catename, storename, codename, catetype, catecant, paytype, saleoneprice, countity, totalprice As String

catename = TextBox1.Text

storename = ComboBox1.SelectedItem

codename = TextBox2.Text

catetype = TextBox3.Text

catecant = TextBox4.Text

paytype = ComboBox2.SelectedItem

saleoneprice = TextBox5.Text

countity = TextBox6.Text

totalprice = TextBox7.Text

If catename = "" Or catetype = "" Or catecant = "" Or saleoneprice = "" Or countity = "" Or totalprice = "" Then

MsgBox(" من فضلك ادخل جميع البيانات ")

Exit Sub

End If

Try

Dim cm2 As New OleDbCommand

cm2.Connection = cnn

cm2.CommandText = "insert into cate (catename, storename, codename, catetype, catecant, paytype, saleoneprice, countity, totalprice )values ('" & catename & "','" & storename & "','" & codename & "','" & catetype & "','" & catecant & "','" & paytype & "','" & saleoneprice & "','" & countity & "','" & totalprice & "', # '" & DateTimePicker1.Value.ToShortDateString & "' #,'" & Now.ToShortTimeString() & "')"

cm2.ExecuteReader()

MsgBox("تم اضافه الصنف بنجاح ")

TextBox1.Text = ""

TextBox3.Text = ""

TextBox4.Text = ""

TextBox5.Text = 0

TextBox6.Text = 0

TextBox7.Text = 0

Catch ex As Exception

MsgBox(ex.Message)

End Try

		Dim catename, storename, codename, catetype, catecant, paytype, saleoneprice, countity, totalprice As String
		catename = TextBox1.Text
		storename = ComboBox1.SelectedItem
		codename = TextBox2.Text
		catetype = TextBox3.Text
		catecant = TextBox4.Text
		paytype = ComboBox2.SelectedItem
		saleoneprice = TextBox5.Text
		countity = TextBox6.Text
		totalprice = TextBox7.Text
		If catename = "" Or catetype = "" Or catecant = "" Or saleoneprice = "" Or countity = "" Or totalprice = "" Then
			MsgBox(" من فضلك ادخل جميع البيانات ")
			Exit Sub
		End If
		Try
			Dim cm2 As New OleDbCommand
			cm2.Connection = cnn
			cm2.CommandText = "insert into cate (catename, storename, codename, catetype, catecant, paytype, saleoneprice, countity, totalprice )values ('" & catename & "','" & storename & "','" & codename & "','" & catetype & "','" & catecant & "','" & paytype & "','" & saleoneprice & "','" & countity & "','" & totalprice & "', # '" & DateTimePicker1.Value.ToShortDateString & "' #,'" & Now.ToShortTimeString() & "')"
			cm2.ExecuteReader()
			MsgBox("تم اضافه الصنف بنجاح ")
			TextBox1.Text = ""
			TextBox3.Text = ""
			TextBox4.Text = ""
			TextBox5.Text = 0
			TextBox6.Text = 0
			TextBox7.Text = 0
		Catch ex As Exception
			MsgBox(ex.Message)
		End Try

الخير هنا ربى اغفر لى ولوالدى وللمؤمنين يوم يقوم الحساب000 امين

#3

عدد الحقول اللى بتستخدمهم للأدخال فى عبارة Insert تسع حقول وعدد القيم فى Value احدى عشر

لبد ان يتساوى الأثنين

كل من فى الوجود يطلب صيداً :::: غير ان الشباك مختلفات

#4

الاخ الفاضل njd للاسف عند تنفيذ ماقلت ظهرت رساله خطاء اخرى ولك خالص تحياتى

الاخ الفاضل hazzoom شكرا على مداخلتك ومش عيب ان الواحد يخطا ويصلح الخطا وياريت بعد ذلك قمت حضرتك بشرح الخطا كان الامر يهون حتى نكون استفدنا من حضرتك حاجه تقبل اسفى يمكن اكون تلميذ خايب بس بحاول اتعلم .

الخير هنا ربى اغفر لى ولوالدى وللمؤمنين يوم يقوم الحساب000 امين

هذا الموضوع مغلق.

مواضيع مشابهة