You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 1. [Database](https://github.com/redmalmon/CSharf-Custom-Classes/blob/main/C-Sharf%20Classes/Classes/Database.cs) class - for database configuration
10
+
### 1. [Database](https://github.com/redmalmon/CSharf-Custom-Classes/blob/main/C-Sharf%20Classes/Classes/Database.cs) class - this is use for MySqlClient configurations, sql statements, & etc.
11
11
12
-
* Instantiate
12
+
* Instantiation - creating an object `db` from a class type `Database` and instantiate using the `new` keyword.
// instantiate an object `db` from `Database` class
15
18
Databasedb=newDatabase();
16
19
```
17
20
18
-
SQL Statements
21
+
#### Using Database' Methods
22
+
23
+
- Sql Statements
19
24
20
-
*Select
25
+
*`select(string qry)` or select() method is use for `select` statements and this method return `MySqlDataReader` that reads a forward-only stream of rows from a MySQL database.
21
26
22
27
```c#
23
28
varreader=db.select("select * from users");
@@ -27,22 +32,22 @@ while (reader.Read())
27
32
}
28
33
```
29
34
30
-
*Insert
35
+
*`save(string table, string[] column, string[] bind)` or save() method is use for `insert into` statements and does not return a value. This methods display a MessageBox for showing the result of your sql statement. The `table` parameter is use to pass your table_name from your database, while `column` parameter is use to pass your collection of column_name from your database table, and the `bind` parameter is for the collection of values of the columns.
0 commit comments