Training 4 - Simple CRUD On C# Programming
Training 4 - Simple CRUD On C# Programming
Part 1
Environment C#?
• MSSQL SERVER
• Microsoft Visual Studio
• Microsoft Sql Server Management Studio
MSSMS C#?
• Restart
MSSMS C#?
1 Label
1 2 3
2 TextBox
3 Button
4
4 DataGrid View
Simple CRUD C#?
class Employee
{
public Employee(int intId, string txtName)
{
this.intId = intId;
this.txtName = txtName;
}
public int intId { get; set; } = 0;
public string txtName { get; set; } = string.Empty;
}
throw e;
}
finally
{
if(sqlConnection.State == ConnectionState.Open)
{
sqlConnection.Close();
}
}
}
Fill Data C#?
if (employee == null)
{
simpan(txtBoxName.Text.ToString());
}
else
{
update(employee.intId, txtBoxName.Text.ToString());
}
refresh();
delete();
CRUD C#?
Event Button C#?