Posts

DB backup under SQL Express

SQL Express has no Jobs engine. And Shared SQL server as well. So Management->Maintenance Plans is not exists.
So there is a batch file that you can put in Windows Scheduler to create db backups:

@echo off

set databaseName=%1
echo %databaseName%

set backupFolder=%2
echo %backupFolder%

for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
echo %fullstamp%

set OutDir=%backupFolder%\%databaseName%_%fullstamp%.bak
echo %OutDir%

sqlcmd -S <serverName\instanceName> -U <user> -P <pass> -Q "BACKUP DATABASE [%databaseName%] TO disk='%OutDir%'"


ReferencesFilename timestamp in Windows CMD batch script Automate the Ba…

Decimal number issue from server to client. Wow! Didn't expect this @_@

Image
Chapter 17where poor Decimal Number came from Server Side to JavaScript

I worked on some page for days to adjust UI by CSS and HTML changes. It was pretty OK and fine. Until I started to check this page for multi-lingual support...

It was good for English, Spanish and Chinese. And even right-to-left Hebrew! Crooked and askew but working!
But not in Russian, no! In Russian it stopped working at all - nothing except static texts and images wasn't appeared. And of course it was an error in JS :-\ (FireFox DevTools):

that led me strangely to somewhere to this code:

I was staring on this rows and saw nothing wrong there - no missing variables at all. I went to original code in the project to discover the non-rendered rows and saw server variable there:

that led me to server side C#:

Nothing wrong at all.

Here and there - another 10-15 minutes wasted to dumbly running the page again and again and stupidly staring on all these rows in different windows... :-\ Sad...

Until suddenly, I dec…

Configuring IIS to allow CORS requests

Image
The problem:  sending ajax requests from HTML5 application on local machine to my API that hosted under IIS on Google Cloud.

The facts: 
The code looks like:
        $.post({
            url: apiEndpoint + "Init",
            contentType: "application/json; charset=utf-8",
            data: data,
            success: function (response) {
                logResponse("API response [Init]", response.d);
            },
            error: function (xhr, status, error) {
                logResponse('Fail to call init API', data);
            }
        });
The error was looks like:
Originally, there was "crossDomain: true" parameter in ajax request but it doesn't help.
There were crossdomain.xml and clientaccesspolicy.xml on the server and they were helpless as well.

The way:
I went to internet for advice and saw many and many solutions for ajax - nothing doesn't help. What I tried: - add to ajax                  headers: {             …

TRIM unwanted chars from string in SQL

It's pretty simple but I didn't know this:
TRIM('.,! ' FROM '# test .')

Error starting SQL Server 2017 service. Error Code 3417 - Fixed

It's already a third time I uninstall and install again SQL Server 2017 Dev version on my local computer...
It's working fine for few days and than suddenly stop running with Error Code 3417:
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online. I tried many ways to fix this, including security changes on master.mdf and of course full re-install.
Until suddenly I saw in MS SQL log file this error before the main error:
Error: 2775, Severity: 17, State: 12.The code page 65001 is not supported by the server I went to find this error in Google and I foundthisarticle, where the author talked with himself about logs, errors, screenshots and questions about them. Until in the bottom of the article he wrote:
Uncheck Beta: Use Unicode UTF-8 for worldwide language support in Control Panel -> Region -> Administrative ->…

Please welcome our new application - ArtPlayBox!

Image
Hi all,
Please welcome our first Android application ArtPlayBox!
It's designed for tablets but supports smartphones as well. 

Reviews, stars and post shares will be very appreciated! :-) Thank you in advance!

Company Site Update

I make some changes in my site.
The most of them is a prototype of universal content localization engine that can be applyed on web content without changes in DB or server-side code. It's a good start for Language Medium platform that is going to be easy and useful.
NOTE: not all text content is localized to Russian right now - only menu, first section and few first Projects. It's becasue the engine is without BackOffice right now and all translations I'm adding  directly in DB:-) But don't worry - it will be soon B-)

Also there are links to projects pages and some of them are real :-)