• Total Source Code 3
  • Total Page : 1
  • You currently on page number : 1

Reading From Database

  • 00 0000
  • 631
  • 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), Read more

Database Connection

  • 00 0000
  • 641
  • 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 Read more


  • 00 0000
  • 640
  • 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 Read more