Riccardo Bassilichi
Riccardo Bassilichi

Reputation: 969

LinQ To SQL And DataBinding

I have a form (WinForms) with a TextBox Binded to a Datasource.

The datasource is a LinQ To SQL query returning one single row. This row have only one filed, varchar(100), not nullable.

My problem is that if the user go to the field (with the focus), he can't exit while he insert a data because the data field cannot accept null.

It is possible to bind a TextBox to a field not nullable and not validate each single filed but the entire form ?

Thank You!

Upvotes: 2

Views: 336

Answers (1)

Jay
Jay

Reputation: 57959

You can bind one-way, but then you'll have to update the L2S entity manually when the user clicks "save" or "ok."

You could also provide a default value, so the user can tab through the textbox, but you might see that default value appearing in your database.

Upvotes: 1

Related Questions