Itzik S

Itzik S

  • NA
  • 34
  • 0

ExecuteNonQuery returns 1 , Database wont Update

Jun 11 2009 7:59 AM
hello i am creating a Windows Application C# 3.5 when i executeing function to insert into SQL Epxress it returns 1 on the Rows Effect but checking the Database Data nothing is inserted. public int ExectueNonQuery(string command) { int Results = -1; try { connection = new SqlConnection(ConnectionString); connection.Open(); scommand = new SqlCommand(command, connection); Results = scommand.ExecuteNonQuery(); } finally { scommand.Dispose(); if (connection != null) connection.Close(); } return Results; }

Answers (7)