Hi, i'm making an desktop application(no client,server) in
vb.net that can insert, update and remove rows from a db. I have 3 classes:
I have a form with textboxes, that represents a name and a date. A form saves it's data into a rwPatient object.
A class rwPatient representing a row where you can set the name and the date of the patient.
and a class tblPatient that represents a table that can do sorts, addrow,removerow etc.
before I do an (insert, update) I store the textboxes values into the rwPatient object using the function getFormValues() as rwPatient.
wich loops throught the form textboxes and sets the rwPatient values to the .text property of the textbox.
I have some design problems handling empty textboxes.
Should I handle empty textboxes on the form? ie
if txtName = vbnullstring then
messagebox.show("Srry the name field can't be left empty")
Or should I make all the fields nullable(of type) inside the rwPatient class and then in the form if the textbox is empty insert nothing in rwPatient, wich will return a error message event.
I have to use nullable becaus Date cannot be nothing.
I think the second is better, because errorhandling is all into one class, and mayby later on it is allowed to have a null value for date for example.
What would you suggest.