Best Way To Validate Data Entry in VB.Net 2003

  • Thread starter Thread starter Atley
  • Start date Start date
A

Atley

I am trying to figure out the best way to ensure that a valid date or a
valid number has been entered into a field. Any suggestions?

Thanks...

Atley
 
The VB version of this should work :

try
{
dset_Row[sa_MainFrame00Rows[3]] =
Convert.ToDateTime(textBox00102.Text);
}
catch
{
sbStatusBarMainFrame.Text = sa_DataError[0]+sa_MainFrame00Rows[3]+" :
"+textBox00102.Text;
tabControl0011.SelectedIndex = 0; // works with
Framework.Compact
// tabControl0011.IndexOf(tabPageMainFrame00Name); // Does not work
MessageBox.Show(sbStatusBarMainFrame.Text);
textBox00102.Focus();
return false;
}

try
{
dset_Row[sa_MainFrame01Rows[3]] = Convert.ToInt32(textBox01100.Text);
}
catch
{
sbStatusBarMainFrame.Text = sa_DataError[1]+sa_MainFrame01Rows[3]+" :
"+textBox01100.Text;
tabControl0111.SelectedIndex = 0;
MessageBox.Show(sbStatusBarMainFrame.Text);
textBox01100.Focus();
return false;
}
try
{
dset_Row[sa_MainFrame01Rows[4]] = Convert.ToDouble(textBox01110.Text);
}
catch
{
sbStatusBarMainFrame.Text = sa_DataError[1]+sa_MainFrame01Rows[4]+" :
"+textBox01110.Text;
tabControl0111.SelectedIndex = 1;
MessageBox.Show(sbStatusBarMainFrame.Text);
textBox01110.Focus();
return false;
}

Mark Johnson, Berlin Germany
(e-mail address removed)
 
Back
Top