Page 52 - CSharp/C#
P. 52
Creating simple CRUD using SQLite in C# 872
Executing Query 876
Chapter 158: Using Statement 877
Introduction 877
Syntax 877
Remarks 877
Examples 877
Using Statement Basics 877
Returning from using block 878
Multiple using statements with one block 879
Gotcha: returning the resource which you are disposing 880
Using statements are null-safe 880
Gotcha: Exception in Dispose method masking other errors in Using blocks 881
Using Statements and Database Connections 881
Common IDisposable Data Classes 882
Common Access Pattern for ADO.NET Connections 882
Using Statements with DataContexts 883
Using Dispose Syntax to define custom scope 883
Executing code in constraint context 884
Chapter 159: Value type vs Reference type 886
Syntax 886
Remarks 886
Introduction 886
Value types 886
Reference types 886
Major Differences 886
Value types exist on the stack, reference types exist on the heap 886
Value types don't change when you change them in a method, reference types do 887
Value types cannot be null, reference types can 887
Examples 887
Changing values elsewhere 887
Passing by reference 888

