You want to store the DPI used by your scanner in your db ? It's just an int, storing it is easy. Setting it is the hard bit. There's no TWAIN support in C#, and limited WIA support, so, it depends on if your scanning code has access to DPI settings.
I found this code using google. You should try it.
private void setItem(IItem item, object property, object value)
{
WIA.Property aProperty = item.Properties.get_Item(ref property);
aProperty.set_Value(ref value);
}
internal bool Scan(bool flatBed)
{
WIA.DeviceManager manager = new DeviceManager();
bool result = false;
object something = 1;
object somethingElse;
WIA.Device scanner = manager.DeviceInfos.get_Item(ref something).Connect();
IItem item = scanner.Items[1];
setItem(item, "6146", 4);
setItem(item, "6147", 200);
setItem(item, "6148", 200);
setItem(item, "6151", 200 * 8.5);
setItem(item, "6152", 200 * 11);
}
The first setItem is the color [4 black and white, 2 grayscale, 1 color, 0 unspecified]
The second is horizontal resolution.
The third is veritcal resolution.
The fourth is horizontal scanning area.
The fifth is vertical scanning area.