- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Chandu yadav has Published 1163 Articles
Chandu yadav
212 Views
The current MySQL transaction will be committed and ended when any of the DDL statement such as CREATE or DROP databases, Create, ALTER or DROP tables or stored routines is executed in the middle of the current transaction. All the database changes made in the current transaction will be made ... Read More
Chandu yadav
354 Views
A list is a Generic collection to hold elements of same datatypes.To clone a list, you can use the CopyTo method.Declare a list and add elements −List < string > myList = new List < string > (); myList.Add("Programming"); myList.Add("Web Dev"); myList.Add("Database");Now create a new array and clone the list ... Read More
Chandu yadav
1K+ Views
Set the two dictionaries −Dictionary < string, int > dict1 = new Dictionary < string, int > (); dict1.Add("laptop", 1); dict1.Add("desktop", 2); Dictionary < string, int > dict2 = new Dictionary < string, int > (); dict2.Add("desktop", 3); dict2.Add("tablet", 4); dict2.Add("mobile", 5);Now use HashSet and UnionWith() method to merge the ... Read More
Chandu yadav
467 Views
Synchronize access to resources in multithreaded applications using Synchronization.Mutex to Synchronize ThreadsA mutex can be used to synchronize threads across processes. Use it to prevent the simultaneous execution of a block of code by more than one thread at a time.C# lock statement is used to ensure that a block ... Read More
Chandu yadav
1K+ Views
Create a method to get the nth value with recursion.public int displayFibonacci(int n)Call the method −displayFibonacci(val)On calling, the displayFibonacci() meyhod gets called and calculate the nth value using recursion.public int displayFibonacci(int n) { if (n == 0) { return 0; } if (n == ... Read More
Chandu yadav
2K+ Views
Declare and initialize a list.var products = new List (); products.Add("Accessories"); products.Add("Clothing"); products.Add("Footwear");To get the size, use the Capacity property.products.CapacityNow let us see the complete code to find the size of a list.Example Live Demousing System; using System.Collections.Generic; public class Demo { public static void Main(string[] args) { ... Read More
Chandu yadav
411 Views
To get the sum of digits using recursion, set a method in C# that calculates the sum.static int sum(int n) { if (n != 0) { return (n % 10 + sum(n / 10)); } else { return 0; }The above ... Read More
Chandu yadav
168 Views
Firstly, declare a HashSet and add elements −var names = new HashSet(); names.Add("Tim"); names.Add("John"); names.Add("Tom"); names.Add("Kevin");To remove an element, use RemoveWhere.names.RemoveWhere(x => x == "John");Let us see the complete example −Exampleusing System; using System.Collections.Generic; public class Program { public static void Main() { var names = ... Read More
Chandu yadav
12K+ Views
All these keywords are part of the main method of any C# program.The Main method, which is the entry point for all C# programs states that what a class does when it executed.using System; class Demo { static void Main(string[] args) { Console.WriteLine("My first program in C#!"); } ... Read More
Chandu yadav
1K+ Views
The best IDE for C# on Windows is Microsoft Visual Studio. It is an IDE to develop websites, web apps, mobile apps, etc.The following are the features of Visual Studio IDE −Code Editor − Visual Studio has a code editor supporting syntax highlighting and code completion using IntelliSense.Breakpoints − Set ... Read More