| |||||||
| Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Jul 2004
Posts: 380
Thanks: 0
Thanked 2 Times in 2 Posts
| Hi I need some help with my plugin. Somebody wants to help me out? 1/ How do I CLEAR a database? I want to delete all the records, but I can't delete the file itself because MP is locking it. 2/ How do I refresh a view in MP. Example. the skin shows a database content, and the user presses refresh to load a new file in the database. How do I make that new information show up on the screen. Is there a function in MP to RELOAD the screen? Thanks in advance //Lasse
__________________ ---------------------------------------- MCE 2005 Twinhan 3040 DVB-T + CI + Cam---Boxer ATI Radeon 9800 Pro 128Mb SoundMax 1950 1Gb Ram ----------------------------------------- |
| | |
| |
| | #2 (permalink) | |
| Portal Member Join Date: Aug 2004 Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
Code: DELETE FROM <table name> Code: DELETE FROM programs To make MP reload the screen, it depends on what screen, but for most screens with a list in it, just call the LoadDirectory("") method (check to see if it exists - I know it works for the music module). Sam | |
| | |
| | #3 (permalink) |
| Portal Member Join Date: Jul 2004
Posts: 380
Thanks: 0
Thanked 2 Times in 2 Posts
| Thank u very very much //Lasse
__________________ ---------------------------------------- MCE 2005 Twinhan 3040 DVB-T + CI + Cam---Boxer ATI Radeon 9800 Pro 128Mb SoundMax 1950 1Gb Ram ----------------------------------------- |
| | |
| | #4 (permalink) |
| Portal Member Join Date: Jul 2004
Posts: 380
Thanks: 0
Thanked 2 Times in 2 Posts
| So if I wanted to delete all records in the table DVD, should it look like this DVD_DB myDVD_db=null; // Open Database myDVD_db = new DVD_DB(); myDVD_db.Execute DELETE FROM dvd Well I know it should look like that since I get a expexted ; here and there, but I can't figure it out. Can u help me some more, please //Lasse
__________________ ---------------------------------------- MCE 2005 Twinhan 3040 DVB-T + CI + Cam---Boxer ATI Radeon 9800 Pro 128Mb SoundMax 1950 1Gb Ram ----------------------------------------- |
| | |
| | #5 (permalink) | |
| Portal Member Join Date: Aug 2004 Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts
| Quote:
Another thing, in MP you can't use the existing code to clear the database (i.e. reference Databases.dll and use the functions in there) because there is no function to clear the database and you can't access the database variable directly (its not public). So you will need your own code to open the database connection: Code: function ClearDatabase()
{
SQLiteClient m_db=null;
Log.Write("opening video database");
try
{
// Open database
try
{
System.IO.Directory.CreateDirectory("database");
}
catch(Exception){}
m_db = new SQLiteClient(@"database\videodatabase2.db");
}
catch (Exception ex)
{
Log.Write("videodatabase exception err:{0} stack:{1}", ex.Message,ex.StackTrace);
}
Log.Write("video database opened");
//now for each table, do this, replacing movie with the table name.
m_db.Execute("DELETE FROM movie");
//close and dispose of the database
m_db.Close();
m_db = null;
}
whoops, forgot to tell you that you need to add the following statements at the top of the file: Code: using SQLite.NET; using MediaPortal.Util; Sam | |
| | |
| | #6 (permalink) |
| Portal Member Join Date: Jul 2004
Posts: 380
Thanks: 0
Thanked 2 Times in 2 Posts
| thank u .Will give it another try tonite. //Lasse
__________________ ---------------------------------------- MCE 2005 Twinhan 3040 DVB-T + CI + Cam---Boxer ATI Radeon 9800 Pro 128Mb SoundMax 1950 1Gb Ram ----------------------------------------- |
| | |
![]() |
| Bookmarks |
| Tags |
| wanted |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New version of the MP webinterface! Translators wanted! | Maschine | Plugins | 55 | 2008-08-07 13:36 |
| dvb-c frequencies wanted for CAIW Netherlands | tjeerd | Installation, configuration support | 5 | 2007-06-18 10:29 |
| People with DirectX knowledge wanted! | frodo | General Development (no feature request here!) | 17 | 2006-10-05 20:32 |
| First and new HTPC, comments wanted | timppala | HTPC Projects | 1 | 2006-08-10 08:23 |
| Help Wanted from Europeans - Hauppauge PVR500 and MCE Remote | Brocklander | Ongoing HTPC Projects | 1 | 2005-11-22 09:34 |