I am using the ADO.net SQLite provider. I want to control some SQLite "functions", for example, allow a string in an integer field and allow a string longer than n in a field of type varchar (n). What is the best way to achieve this kind of validation? Stored procedures? triggers? I am looking for a universal solution that applies to any database, not just my database schema.
You can add column constraints.
create table example ( age integer not null check (typeof(age)='integer'), name text not null check (length(name) between 1 and 100), salary integer check (salary is null or typeof(salary)='integer') )
, , , . , ( mothersmaidenname - ). " " - ( ) , .
Confirm in your C # the POCO domain model , and not in SQLite db, using something like DataAnnotationsor even this method .
DataAnnotations
Source: https://habr.com/ru/post/1723010/More articles:Updating Ajax data. Extjs - javascriptHow to print array keys like $ _POST in PHP? - arraysDelphi MREW implementation that favors readers? - multithreadingCan I use the click and keyboard handler for RaphaelJS canvas events? - javascriptHow to execute shell script via sudo user - shShared Drupal tables, but from a different database - phpVisual Studio plugins for C ++ - c ++Triggers in oracle - oracleScrolling TabPanel - gwtFlex Layout review - any way to get your preferred component size? - flexAll Articles