What are destructors in C # In C # Class is instantiated when Constructors are used but when an Object of a Class is deleted Class Destructors are automatically invoked. There can be only one destructor for a class. A Destructor is not called / cannot be called, it is invoked automatically. A Destructor cannot be modified using modifiers A Destructor cannot have parameters A Destructor Shares same name with the Class but a “ ~ ”  TILDE is used with it Let’s see an example: Classname | ~Classname Example Program in C# class Person { public Person() { Console.WriteLine(“This is a Constructor”); } ~Person()Read More →

Insert Values into Database in Asp.net using C# Here is How Our Aspx file will look in Design View – Please Note : Respected “IDs” of Form Fields. Use Following Namespaces in your C# code : using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Text; using System.Data.SqlClient; using System.Configuration; Code your button click like this : On Button Click An Insert Statement will be executed Note : In our case Table Columns are country, city and area and their values will be fetched from DropDownlist1 , txtCity and TextCountry respectively. protected void btnCity_Click(object sender, EventArgs e) { tryRead More →

We use Visual Studio to create and run programs in C# Language. Open Visual Studio and Create new Console Application in C #. Console Applications Interface has “Only Texts” Your First Program will look like this using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Escalera { class Program { static void Main(string[] args) { // “we will code here” } } } All C# console application should have a method (which is a function) named Main. Program Execution Starts from Here . Lets Print the sentence in our console application static void Main(string[] args) {        Console.Writeline(“I am Learning C# From EscaleraRead More →