views:

42

answers:

2

I have a table inside my database, and i wish to insert/update/delete entries in a FormView Manner (I mean no datagrid) but a set of textbox/combobox/listbox/checkbox for one record. Before modifying/adding data i have to perform some extra checks to enter correct values to my database. How will i be best off doing it? I am currently using a datatableadapter to perform datatableadpter.insert, and also datatableadpater.update. How can i make use of datasets here and what is the best way for it?

Sorry i forgot to mention but i want it in Winforms not ASP!

A: 
  1. Use Validators on the controls
  2. Use the FormView Control and it's Data Source to configure the updating/deleting/selecting if possible. For the data source you can use the Inserted, Inserting, FormView_ItemInserted events that you can work with....
  3. The Form View has buttons for save, etc... you can also code extra in there...

I realize this isn't having you directly work with a dataset in code but unless you need 100% complete control over this I think the above is the way to go.

klabranche
i said formview manner to explain what i want, but i want in winforms, not ASP.NET!.. asp i found it actually very easy!
Anirudh Goel
Ah... That little etra bit of info definitely changes the answer.... :)
klabranche
+1  A: 

There are no built in validators for Winforms. You'd need to do the validation manually in your save button. If you'd prefer a validation solution for winforms that is similar to validators in asp.net, there is a 3rd party (free solution) available here: http://updatecontrols.net/vb/winforms.shtml

Fake