"OleDbException was Unhandled
No value given for one or more required parameters "
If I hard code the values it works just fine.
Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Database\Database1.accdb")
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim cmd As New OleDbCommand("Insert into Table1 Values(" & TextBox1.Text & ",'" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "')", conn)
conn.Open()
cmd.ExecuteNonQuery()
MsgBox("Successfully Record Saved.....!", MsgBoxStyle.Information)
conn.Close()
End Sub
End Class
Really need this urgently.
Thanking in advance....

New Topic/Question
Reply




MultiQuote





|