Mae
Pipeline Automation Expert
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
This is an example project using OOP C#. Hope this system can help you in your future project. Below are codes used in this system.
Hope you learn from this.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
- using
System
;
- using
System.Collections.Generic
;
- using
System.Linq
;
- using
System.Text
;
- using
System.Data
;
- using
System.Data.OleDb
;
- using
System.Collections
;
- namespace
employeesapp
- {
- class
employee
- {
- public
string
EmpID;
- public
string
Name;
- public
string
Jobtitle;
- public
string
Company;
- public
DataSet get
(
)
- {
- OleDbConnection conn =
new
OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\
Employees.mdb"
)
;
- conn.
Open
(
)
;
- OleDbDataAdapter da =
new
OleDbDataAdapter(
"Select * From employee"
, conn)
;
- DataSet ds =
new
DataSet(
)
;
- da.
Fill
(
ds)
;
- return
ds;
- }
- public
void
AddNew(
)
- {
- OleDbConnection conn =
new
OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\
Employees.mdb"
)
;
- conn.
Open
(
)
;
- OleDbCommand cmd =
new
OleDbCommand(
"Insert Into employee([Name],[Jobtitle],[Company])Values ('"
+
Name +
"','"
+
Jobtitle +
"','"
+
Company +
"')"
, conn)
;
- cmd.
ExecuteNonQuery
(
)
;
- }
- public
void
Update(
)
- {
- OleDbConnection conn =
new
OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\
Employees.mdb"
)
;
- conn.
Open
(
)
;
- //OleDbCommand cmd = new OleDbCommand("Update employee([Name],[Jobtitle],[Company])Values ('" + Name + "','" + Jobtitle + "','" + Company + "')",conn);
- OleDbCommand cmd =
new
OleDbCommand(
" Update employee set ([Name],[Jobtitle],[Company])Values ('"
+
Name +
"','"
+
Jobtitle +
"','"
+
Company +
"' where EmpID='"
+
EmpID +
"')"
, conn)
;
- cmd.
ExecuteNonQuery
(
)
;
- }
- public
void
Delete(
)
- {
- OleDbConnection conn =
new
OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\
Employees.mdb"
)
;
- conn.
Open
(
)
;
- OleDbCommand cmd =
new
OleDbCommand(
"DELETE *FROM employee Where Name = '"
+
Name +
"'"
, conn)
;
- cmd.
ExecuteNonQuery
(
)
;
- }
- }
- }
Hope you learn from this.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Download
You must upgrade your account or reply in the thread to view hidden text.