in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

SQLiteConvert.TypeToDbType public?

Last post 09-25-2007 4:43 AM by kama. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-25-2007 4:43 AM

    • kama
    • Not Ranked
    • Joined on 09-25-2007
    • Posts 1

    SQLiteConvert.TypeToDbType public?

    Hi,

    before posing my question I would like to thank you very much for this provider! Keep up the good work!

    Now, my question: is it possible to set SQLiteConvert.TypeToDbType to public instead of internal? It would be vey useful when you don't know what type a function returns and you have to insert it in the database.

    I ask you this because I am writing a custom ProfileProvider for SQLite, and I'd like to be able to write something like this:

    SettingsPropertyValue pv; 

    object objectToSave; 

     // Set up connection, query etc..

    // Check if we need serialized value etc.. 

    cmd2.Parameters.Add("@Value",

            SQLiteConvert.TypeToDbType(pv.Property.PropertyType)).Value = objectToSave;

     

    The config values can be something like this:

    <add name="Name" type="String" />

    but also: 

    <add name="CustomObject" type="CustomType" serializeAs="Binary" />

     

    Thank you and sorry for my bad english!

    Francesco
     

Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems