tunde Mattieu

tunde Mattieu

  • NA
  • 3
  • 9.7k

insert statement using AddParams

Jul 8 2013 8:04 PM
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)