c# - Application closes without a reason -
my applications quit no reason without error, stops, , don't see why happens. whenever go through in debug mode, stops on line database.cmd.executenonquery()
database.con.open(); using(database.cmd = new idb2command(query, database.con)) { database.cmd.commandtext = query; foreach(var value in para) { database.cmd.parameters.addwithvalue(value.key, value.value); } database.cmd.executenonquery(); } database.con.close();
my query wasn't correct, rather thought connection, searched in wrong place... anyways, guys :-)
put whole code try catch block , print exception message in label or popup. exact error being thrown. while in debug mode, can see details of error on exception e
part.
try { //your code } catch(exception e) { label1.text = e.message; }
the issue may database instance.
Comments
Post a Comment