Archive for C# general questions
You are browsing the archives of C# general questions.
You are browsing the archives of C# general questions.
What is the wildcard character in SQL? Let us say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve La%. What is the role of the DataReader class in ADO.NET connections? It returns a read-only dataset from [...]
Can I define a type that is an alias of another type (like typedef in C++)? Not exactly. You can create an alias within a single file with the “using” directive: using System; using Integer = System.Int32; // alias But you can’t create a true alias, one that extends beyond the file in which it [...]
How do you mark a method obsolete? [Obsolete] public int Foo() {…} or [Obsolete(\"This is a message describing why this method is obsolete\")] public int Foo() {…} Note: The O in Obsolete is always capitalized. How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#? You want the lock statement, which is the same [...]