7
Answers

ExecuteNonQuery returns 1 , Database wont Update

Itzik S

Itzik S

15y
8.8k
1
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)