Posts

Remove items from list that appears in another list by ID

I tried many options and stopped on this one: lst1.RemoveAll(itemFromLst1 => lst2.Any(itemFromLst2 => itemFromLst2.ID == itemFromLst1.ID));

Pluralizing words in C#.Net

Today I wanted to create a dynamic title of a page according to name of category. Like "My Playlists", "My Libraries" etc. So there is a parameter of categoryID passing to page and I find category object accordingly. So there is a usage of .Net service: using System.Data.Entity.Design.PluralizationServices; .... Category category = Category.GetByID(categoryID); PluralizationService ps = PluralizationService.CreateService( new System.Globalization.CultureInfo( "en-GB" )); Page.Title = $"My { ps.Pluralize( category .Name) }" ; ..... Note : you need to add reference System.Data.Entity.Design to the project.

MongoDB Cloud Cluster Test

Today I performed initial basic test of  MongoDB Atlas  - it's MongoDB Cloud Cluster that can use different cloud providers. This process took me something like an hour to get my test system working. It's amaizing timing IMHO. And I'm happy to admit that I succesfully connect this cluster to .Net aplication using MongoDB Official driver - this part was not succeeded around an half a year ago in my previous company. Now I know the problem we faced there - it's incorrect connection string. Only incorrect connection string. And we failed. It's sad.... :-( P.S. As a client I used MongoDB Compass that is free and light but lack of major DBA features and UI. And I'm going to use something more powerfull, like Studio3T that I tried once and was very satisfied.

Information and methods to handle it

Image

"low disk space on recovery drive windows 10" Saga

Image
Few months ago, after some big update of Win 10, I started to get annoying notifications: This message appeared randomly without any systematic causes. The system looked like this: I endured this for a long time but finally decided to fix it. And I had a plan to slice small piece from C: and extend E: to this piece. Note: disk D: is removable disk so C: and E: are on same HDD and they siblings :-) So I went to Disk Management to fix this and I saw this thing: E: drive hasn't major actions of another drives include "Extend Volume..." Anyway I sliced 2Gb from my C: drive with "Shrink Volume..." option. I got Additional unallocated space between C: and E: drives. After that I tried many "dances with tamburin around a campfire" - move E: after C:, allocate new space etc. Nothing didn't help. I know that there is limitations of built-in utilities of Windows and I started to search around the Net... All leads told me that I should use ...

SQLite To MS SQL (continuation)

So there is an evolution of this process - SQL script that import SQLite linked DB to MS SQL DB: declare @ temp table ( col1 varchar ( 255 ), col2 varchar ( 255 ), [ name ] varchar ( 255 ), [ type ] varchar ( 255 ), col3 varchar ( 255 ) ) insert @ temp exec sp_tables_ex 'Your_LinkedServer_Name' select * from @ temp And also open a cursor: DECLARE lstTables CURSOR FOR select [ name ] from @ temp

SQLite To MS SQL or Access

Image
This is the working instructions to open SQLite DB in MS SQL or Access Creating a SQL Server Linked Server to SQLite to Import Data The main point is ODBC Driver declaration in System DSN. After this you can link the DB to MS SQL or open it in Access as well. The short list of steps: Install ODBC driver for SQLite ( http://www.ch-werner.de/sqliteodbc/ ) Create a System DSN for the DB file (via C:\Windows\SysWOW64\odbcad32.exe or odbcad64.exe) Create a linked server in SQL Server Just few remarks: Don't use spaces in System DSN name - it will be a problem to work with select queries in MS SQL It also opens as Access DB Despite of possibility to open DB in Access, an import from Access to MS SQL was failed because there are no fields detected during export procedure. It's sad...  For browsing of original file I used the recommended soft  DB Browser for SQLite