Last post Jun 02, 2017 08:43 AM by NJ2
Jun 01, 2017 07:39 AM|NJ2|LINK
I have a long list of sql parameters (SqlParameter param = new SqlParameter;) and the following code executes without any errors but I don not see record inserted in the database. I am not able to figure out why it is not inserting and no errors are
Is there a way to see exactly what is being executed in SQL Server? If I get the query then I can execute that query directly in the database and see what happens.
for (int i = 0; i < param.Length; i++)
cmd.CommandType = CommandType.Text;
Jun 01, 2017 09:15 AM|jimmy69|LINK
use the sql profiler for capturing what is send to your database perhpas : http://www.connectsql.com/2011/10/sql-server-using-sql-profiler-to.html
or perhpas copy the sql with parameters and value and see if some records are modified ...
don't forget that executeNonQuery returns the number of record that has modified ...perhpas no records are modified !
Jun 02, 2017 08:43 AM|NJ2|LINK
I've figured it our... One of the sql parameter type was not valid.