Database for MP plugin (1 Viewer)

Dragy

Portal Pro
April 27, 2009
778
333
32
Home Country
Netherlands Netherlands
I would like to use a database for my plugin. My plugin is a home automation plugin for the Home Control Box. I would like to be able to make device groups and as far as I know, a database is the best solution to accomplish this.

How to make a database for use with MP and how to get it in the right folder? (c:\ProgramData\Team MediaPortal\MediaPortal\database\)
I have never made a database for a C# app before. I'm only familiar with MySQL and PHP :)

Thanks!
 

Dragy

Portal Pro
April 27, 2009
778
333
32
Home Country
Netherlands Netherlands
There must be somebody to help me?

I think I need to use de databases.dll ? And then?
 

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Creating a sqllite database is fairly simple. Have a look in the mp source, look at the music code within the database project. All you would need in your plugin is a reference to the sqllite dll

    Something like
    Code:
    using SQLite.NET;
    ...
    Private SQLiteClient MyDB = new SQLiteClient(Config.GetFile(Config.Dir.Database, "mydatabase.db3"));
    
          string strSQL;
          strSQL = String.Format("select xxxx some sql {0} ", strFileName);
    
          SQLiteResultSet results;
          results = MyDB.Execute(strSQL);
     

    Dragy

    Portal Pro
    April 27, 2009
    778
    333
    32
    Home Country
    Netherlands Netherlands
    Wow awesome! I'm going to try some things this evening :)

    edit:
    The pictures database is far more easier then the music database. I'm trying to alter some stuff of the pictures database and I think it will work :)
     

    Users who are viewing this thread

    Top Bottom