PDA

View Full Version : سوال: ارور No Value Given در آپدیت بانک اطلاعاتی



VisualProject
دوشنبه 20 دی 1389, 09:56 صبح
سلام دوستان
وقتی میخوام بانک اطلاعاتی رو آپدیت کنم ، روی ExecuteNonQuery این خطا رو میده : No Value Given For One Or More Required Parameters

هم با DataAdapter این مشکل رو دارم هم با Command
واقعا نتونستم مشکل رو پیدا کنم . اعصابمو خورد کرده

64809

VisualProject
دوشنبه 20 دی 1389, 10:03 صبح
کد با Data Adapter:


Dim str As String = "Insert Into Info Values (Nam='" & txtName.Text & "',Famil='" & txtLastName.Text & "',Adress='" & txtAdress.Text & "',Mail='" & txtMail.Text & "',Phone='" & txtPhone.Text & "',Mobile='" & txtMob.Text & "')"
da = New OleDbDataAdapter
da.InsertCommand = New OleDbCommand(str, conn)
conn.Open()
da.InsertCommand.ExecuteNonQuery()
conn.Close()
کد با Command :


Dim cmd As New OleDbCommand("Insert Into Info Values (Nam='" & txtName.Text & "',Famil='" & txtLastName.Text & "',Adress='" & txtAdress.Text & "',Mail='" & txtMail.Text & "',Phone='" & txtPhone.Text & "',Mobile='" & txtMob.Text & "')", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()