ExecuteNonQuery-
ExecuteNonQuery does not return any data at all. it is used basically to insert update operationas on table.
YoC# | C-Sharp coding simplified
A blog dedicated to C# (C-Sharp) language who every windows developer dreams of mastering. This blog contains all terms of C# language explained in as simple way as possible, to give you a good start as you advance.
Tuesday, December 8, 2015
C# does Datatable.acceptchanges() save changes to the actual database ?
NO!
http://msdn.microsoft.com/en-us/library/system.data.datatable.acceptchanges.aspx
http://msdn.microsoft.com/en-us/library/system.data.datatable.acceptchanges.aspx
When AcceptChanges is called, any DataRow object still in edit mode successfully ends its edits. The DataRowState also changes: all Added and Modified rows become Unchanged, and Deleted rows are removed.
The AcceptChanges method is generally called on a DataTable after you attempt to update the DataSet using the DbDataAdapter.Update method.
So your actual database is unaffected.
Sunday, November 1, 2015
C# What are try, catch and finally
Its pretty simple again as the name suggests,
Remember you shouldn't use a try catch block if you don't expect any errors in the first place
An example of try catch finally would be this;
Remember you shouldn't use a try catch block if you don't expect any errors in the first place
An example of try catch finally would be this;
try { int a = 10; int b = 20; int z = a + b; } catch (Exception e) { Console.WriteLine(e.Message); } finally { Console.WriteLine("Executed"); }
Subscribe to:
Posts (Atom)