Search code examples
c#sql-server-2008datahandler

How to write to Database from datahandler?


I have a datahandler for my Sencha Touch application and am trying to write to a database. When reading from a database, I call reader.Read() and that works just fine. What should I call to run an insert into query on my database from the datahandler? Any thoughts? Thanks!


Solution

  • You can use the ExecuteNonQuery (or async equivalents) of the SqlCommand class.