C Sharp

  • Total Source Code: 5
  • Latest Update Code: Sep 06' 13
  • Total Page : 1
  • You currently on page number : 1

Send Email Through Console

  • 2013-09-06
  • 595

Here is a listing to send an email from C # using the console: using System; using System.Collections.Generic; using System.Text; using System.Net.Mail; using System.Net; class Program { static void Main(string[] args) { Console.WriteLine("[email protected]"); MailAddress to = new MailAddress(Console.ReadLine()); Readmore

Reading From Database

  • 2013-11-14
  • 754
  • C#,code,program,icodeformoney

In this section, we still using the same database as the previous section which is created by the following queries: #Create database CREATE DATABASE IF NOT EXISTS campus; #Activate database USE campus; #Create table CREATE TABLE IF NOT EXISTS students ( id INT PRIMARY KEY AUTO_INCREMENT, fullname VARCHAR(100), gender VARCHAR(10), faculty VARCHAR(50), Readmore

Database Connection

  • 2013-11-14
  • 761
  • C#,program,icodeformoney

To use database in C#, we must first connect to the database. To do that, we use a Connection object. In this case, we use MySqlConnection class. Basically, the code to connect to a database are:var conn = new MySqlConnection();conn.ConnectionString = "Server=localhost; Uid=root; Pwd=123; Port=3306;";conn.Open();//Do something to the Readmore


  • 2013-11-14
  • 790
  • C#,program,icodeformoney

A variable is just a storage for data of values in the program. In programming world, every variables has a datatype and in most programming language, C# included, a variable's datatype is determined when the variable is declared or initialized. There are several ways to declare a variable: [data type] [identifier];[data type] [identifier] = [value];[data type] [identifier Readmore


  • 2013-11-21
  • 688
  • Programming,C#,.Net

LINQ (Language-Integrated Query) in C# is a simple way to query and update a Collection of data. We can use LINQ for example to filter, sort or even merge data in collections. The simplest way to use LINQ is: from [itemIdentifier] in [collection] where [condition] select [itemIdentifier] Below are examples of LINQ usage:class Program {  static void Readmore