public partial class Form1 : FormI don't know what’s wrong with it can’t seem to find the error. It would helpful if you could help me?
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
string[] names = new string[2];
string g = names[2];
}
catch(Exception error) {
MessageBox.Show(error);
}
}
}
Exception message not working
1512
23-Dec-2013
Pravesh Singh
23-Dec-2013There is no overload of Show which accepts an Exception as a parameter. You probably want to show the exception's Message property: