3
Answers

insert statement using AddParams

tunde Mattieu

tunde Mattieu

11y
7.9k
1
Please I am trying out how to use dataAdapter.InsertCommand to insert into the DB. It says AddParams does not exist in my current context..Please is there something i am missing out. below is the code:

           adapter.InsertCommand = myConn.CreateCommand();
            adapter.InsertCommand.CommandText =
                "INSERT INTO Article " +
                "(artId, title, topic, authorId, lines, dateOfPublishing) " +
                "VALUES(@artId, @title, @topic, @authorId, @lines, @dateOfPublishing) ";
            AddParams(adapter.InsertCommand, "artId", "title", "topic", "authorId", "lines", "dateOfPublishing");

I am using visual studio 2012. Anyone with helpful hint.

Thanks.

Answers (3)