in

System.Data.SQLite

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

noob : Implementing SQLiteFunction

Last post 03-05-2008 5:49 PM by Kieran. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-05-2008 3:42 PM

    • Kieran
    • Top 500 Contributor
    • Joined on 03-02-2008
    • Posts 4

    noob : Implementing SQLiteFunction

    Hi.

    We have decided to support both SQLite and SqlServer in our app. In order to not have to recode some TSQL, I'm trying to write a SQLiteFunction for DATEDIFF with the same syntax, but restricted for my purposes to days, months and years.

    So I have a class

    [SQLiteFunction(Name = "DATEDIFF", Arguments = 3, FuncType = FunctionType.Scalar)]

    public class DATEDIFF : SQLiteFunction

    {

    public override object Invoke(object[ args)

    {

       DoSomeStuff()

       return Foo();

    }

    }

    How do I hook it up so SQLite knows about it?

    The class is a part of my application. Do I need to put it into the sqlite source and recompile it?

     

    Filed under:
  • 03-05-2008 3:44 PM In reply to

    • Kieran
    • Top 500 Contributor
    • Joined on 03-02-2008
    • Posts 4

    Re: noob : Implementing SQLiteFunction

    oh, this is in .Net 2.0 (not compact)

  • 03-05-2008 5:49 PM In reply to

    • Kieran
    • Top 500 Contributor
    • Joined on 03-02-2008
    • Posts 4

    Re: noob : Implementing SQLiteFunction

    nevermind, I figured it out.

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