Here is my code. I get error: No value given for one or more required parameters.
Dim DBAdd As New OleDbCommand

DBAdd.Connection = objConnection


DBAdd.Connection.Open()
DBAdd.CommandText = "INSERT INTO Table1 (RecordsID,Material,Component,VID,PID,DownloadPriority)VALUES(11,'Materialtexttext','ComponentTexttext','vidint','pidint',prtyint)"


DBAdd.ExecuteNonQuery()
I tried using update command of OLEDB Data adapters also by adding new row.
But still I could not get record inserted in database.

Are you sure you are giving 6 parameters?

Could you paste your SQL Command text again? It appears broken in your previous post.

Here is my code. I get error: No value given for one or more required parameters.

Dim DBAdd As New OleDbCommand

        DBAdd.Connection = objConnection


        DBAdd.Connection.Open()
        DBAdd.CommandText = "INSERT INTO Table1 (RecordsID,Material,Component,VID,PID,DownloadPriority)
VALUES(11,'Materialtexttext','ComponentTexttext','vidint','pidint',prtyint)"


        DBAdd.ExecuteNonQuery()
        I tried using update command of OLEDB Data adapters also by adding new row.
But still I could not get record inserted in database.

and try using code tags

whats prtyint in the statement, should it not be in qotes too if its a string means 'prtyint'..

Whats prtyint?
Is it a value to go into the DownloadPriority column
Where are you values all coming from and where is the prtyint especially obatined from. Could it be from the value of a textbox or what?

This thread is from 2008. It was resurrected by a hijack, which was moved to a new thread of its own. I assume the original issue is resolved. Closing the thread.

Be a part of the DaniWeb community

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