"Localhost": Public Void String
"Localhost": Public Void String
try
{
String sstatement = "SELECT * FROM product";
MySqlCommand sCommand = new MySqlCommand(sstatement, mysqlCon);
mysqlCon.Open();
ListView1.Items.Clear();
while (mysqlReader.Read())
{
ListView1.Items.Add(mysqlReader.GetInt32(0).ToString());
int index = ListView1.Items.Count - 1;
ListView1.Items[index].SubItems.Add(mysqlReader.GetString(1));
ListView1.Items[index].SubItems.Add(mysqlReader.GetString(2));
ListView1.Items[index].SubItems.Add(mysqlReader.GetDateTime(3).ToShortDateString());
ListView1.Items[index].SubItems.Add(mysqlReader.GetString(4));
}
mysqlCon.Close();
}
catch (Exception sException)
{
MessageBox.Show(sException.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
try
{
sCommand.ExecuteNonQuery();
}
catch (Exception excp)
{
Exception myExcp = new Exception("Could not add user. Error: " +
excp.Message, excp);
throw (myExcp);
}
try
{
sCommand.ExecuteNonQuery();
}
catch (Exception excp)
{
Exception myExcp = new Exception("Could not add user. Error: " +
excp.Message, excp);
throw (myExcp);
}