Visual Studio DB access

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

Ski6
Posts: 22
Joined: Sun Feb 13, 2011 5:10 pm
Location: Santa Rosa, CA

Visual Studio DB access

Post by Ski6 »

As the regexp script does not seem forthcoming, I wanted to see if I could do db updates in VS using SQL calls.

I stumbled past the collation thing for WHERE statements in SELECTs using COLLATE NOCASE for strings, but have had no luck doing UPDATES:
using (SQLiteConnection connection = new SQLiteConnection(constr))
{
string updateQuery = @"UPDATE main.Songs SET SongTitle = @SongTitle WHERE ID = @ID";
var result = connection.Execute(updateQuery, new
{
ID = 320923,
SongTitle = "A different song title"
});
}

This yields a collate error and I can't guess what it wants.
Does anyone know a way to do an SQL UPDATE to the Songs DB? Entity framework? Dapper?
TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

Re: Visual Studio DB access

Post by TIV73 »

There have been a couple of threads where people reported having issues writing to the database (see here and here), so external tool access might not be a thing atm.
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Visual Studio DB access

Post by Peke »

Simply Use Sample Script "SQLeditor" eg. copy from Sample scripts to Scripts.

You can also use that Script to cannibalize what you need for your APP.

Only difference is taht you do not open SQLite Connection but rather thru https://www.mediamonkey.com/webhelp/MM5 ... es/DB.html
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Ski6
Posts: 22
Joined: Sun Feb 13, 2011 5:10 pm
Location: Santa Rosa, CA

Re: Visual Studio DB access

Post by Ski6 »

Thanks Peke! That is very helpful.
Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Visual Studio DB access

Post by Peke »

Hi,
My pleasure. I am curious what you will think of as I had no time to play around much with MM5 API lately.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Post Reply