hi there.
i m trying to write codes for new user to fill in the form, then the new data will into my database,however, my codes doesnt work, i cant figure out what's wrong with my codes.
below are my codes:

Imports System.Data.OleDb
Public Class NewUser
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnCreate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCreate.Click
        Dim DBConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:/login_1.mdb")
        Dim DBCmd As New OleDbCommand
            DBCmd = New OleDbCommand("Insert Into NewUser(UserName,Password,Name,Email) Values (@UserName, @Password, @Name, @Email)", DBConn)

            Dim paramusername As New OleDbParameter("@UserName", OleDbType.VarChar, 50)
            paramusername.Value = txtNUser

            Dim parampassword As New OleDbParameter("@Password", OleDbType.VarChar, 50)
            parampassword.Value = txtNPwd

            Dim paramname As New OleDbParameter("@Name", OleDbType.VarChar, 50)
            paramname.Value = txtName

            Dim paramemail As New OleDbParameter("@Email", OleDbType.VarChar, 50)
            paramemail.Value = txtEmail

        Catch exp As Exception
        End Try

        DBConn = Nothing
    End Sub
End Class

there is no error encounter, however,the adding is failed and no new data can be add in.
anyone know what's wrong with my codes?..

thank you.

remove Provider=Microsoft.Jet.OLEDB.4.0 from ur code and thev try it will work

there is error saying oledb provider is required..

i have tried to convert the value in the textbox to string, however, there is still an error saying that "Syntax error with Insert Into",
but i cant figure out what's wrong with my Insert Into statement.

i solved the problem already.
it's because of the fields name i was using were reserved words.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.