Visual Studio DB access

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Visual Studio DB access

Re: Visual Studio DB access

by Peke » Wed Sep 08, 2021 5:47 am

Hi,
My pleasure. I am curious what you will think of as I had no time to play around much with MM5 API lately.

Re: Visual Studio DB access

by Ski6 » Tue Sep 07, 2021 11:08 pm

Thanks Peke! That is very helpful.

Re: Visual Studio DB access

by Peke » Tue Sep 07, 2021 8:00 pm

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

Re: Visual Studio DB access

by TIV73 » Tue Sep 07, 2021 3:32 pm

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.

Visual Studio DB access

by Ski6 » Tue Sep 07, 2021 12:52 pm

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?

Top