[thelist] .NET and MSSQL data validation

Ken Schaefer Ken at adOpenStatic.com
Sat Jun 30 03:26:11 CDT 2007


Joel,

I think you can do this just fine with the built-in .NET v2 validators. These
run on the both the client and server side by default.

Assuming you do this via a set of drop-down <select> elements you can use the
onSelectedIndex changed event of the primary listbox to populate the
secondary listbox. 

My understanding of the way the page lifecycle works, is that .NET will
reconstruct the control state on the server side when the form is posted
back, and your validation will run against what is valid for that particular
page state.

Cheers
Ken

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Joel D Canfield
Sent: Friday, 29 June 2007 10:26 AM
To: Anthony Baratta; thelist at lists.evolt.org
Subject: Re: [thelist] .NET and MSSQL data validation

[reordered to put the most important on top]

> Second, constraints and such should be a DB level function - 
> not a code level issue. Use the DB first, code as a backup / 

yes, right, exactly - I didn't 'splain myself well.

in the db, *this* data port is connected to *that* office; all proper db
constraints in place.

now, the user goes to set up a new user's info in the db. when they
select the office New User is assigned, and then go to assign their
computer to a data port, the select should only populate with data ports
from that office. normally, I'd restrict the select options using code
(okay, probably way back in the SQL query somewhere.)

will .NET see that connection in the SQL db and assume it for me? that
was what I really meant to ask.

> First off, I'm not a big fan of the built in validation that 
> is part of the web controls. I rolled my own. But I tend to 
> be a maverick about such things.

you may be a maverick, but I've always leant thataway myself, so that's
useful info




More information about the thelist mailing list