Skip to content

Commit 699676e

Browse files
committed
docs
1 parent 9ad18a2 commit 699676e

File tree

10 files changed

+33
-10
lines changed

10 files changed

+33
-10
lines changed

.vs/C-Sharf Classes/v15/.suo

1 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
-2 KB
Binary file not shown.

C-Sharf Classes/obj/Debug/C-Sharf Classes.csproj.FileListAbsolute.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,21 @@ C:\wamp64\www\GIT\CSharf-Custom-Classes-main\CSharf-Custom-Classes\C-Sharf Class
1616
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\CSharf-Custom-Classes\C-Sharf Classes\obj\Debug\C-Sharf Classes.csproj.CopyComplete
1717
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\CSharf-Custom-Classes\C-Sharf Classes\obj\Debug\C-Sharf Classes.exe
1818
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\CSharf-Custom-Classes\C-Sharf Classes\obj\Debug\C-Sharf Classes.pdb
19+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\C-Sharf Classes.exe.config
20+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\C-Sharf Classes.exe
21+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\C-Sharf Classes.pdb
22+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\MySql.Data.dll
23+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\Google.Protobuf.dll
24+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\bin\Debug\MySql.Data.xml
25+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.csprojAssemblyReference.cache
26+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.frmLogin.resources
27+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.Properties.Resources.resources
28+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.View.frmDashboard.resources
29+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.View.frmDataGridView.resources
30+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.View.frmInputs.resources
31+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C_Sharf_Classes.View.frmMain.resources
32+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.csproj.GenerateResource.cache
33+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.csproj.CoreCompileInputs.cache
34+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.csproj.CopyComplete
35+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.exe
36+
C:\wamp64\www\GIT\CSharf-Custom-Classes-main\C-Sharf Classes\obj\Debug\C-Sharf Classes.pdb
Binary file not shown.
0 Bytes
Binary file not shown.
-2 KB
Binary file not shown.

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@ Custom classes for Windows Form Application in C# Developed by Wilfred V. Pine
77

88
## [Classes](https://github.com/redmalmon/CSharf-Custom-Classes/tree/main/C-Sharf%20Classes/Classes)
99

10-
### 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.
1111

12-
* Instantiate
12+
* Instantiation - creating an object `db` from a class type `Database` and instantiate using the `new` keyword.
13+
14+
see: [c-sharfcorner](https://www.c-sharpcorner.com/article/C-Sharp-object-instantiation-part-i-constructors/)
1315

1416
```c#
17+
// instantiate an object `db` from `Database` class
1518
Database db = new Database();
1619
```
1720

18-
SQL Statements
21+
#### Using Database' Methods
22+
23+
- Sql Statements
1924

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.
2126

2227
```c#
2328
var reader = db.select("select * from users");
@@ -27,22 +32,22 @@ while (reader.Read())
2732
}
2833
```
2934

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.
3136

3237
```c#
3338
string[] value = { txtUsername.Text, txtPassword.Text, cmbSex.Text };
3439
string[] column = { "username", "password", "sex" };
3540
db.save("users", column, value);
36-
37-
//or
38-
39-
db.cud("INSERT INTO users (username,password,sex) VALUES ('" + txtUsername.Text + "','" + txtPassword.Text + "','" + cmbSex.Text + "')","Successfully Saved");
4041
```
4142

42-
* Update & Delete
43+
* `cud(string qry, string msg = "")`
4344

4445
```c#
4546
db.cud("Sql Query Here","Successfully Saved/Updated/Deleted");
47+
48+
db.cud("INSERT INTO users (username,password,sex) VALUES ('" + txtUsername.Text + "','" + txtPassword.Text + "','" + cmbSex.Text + "')","Successfully Saved");
49+
50+
4651
```
4752

4853
* Display to DataGridView (datasource)

0 commit comments

Comments
 (0)