Kendo UI: Paging message not showing in Data Grid

From this Post: Paging message not showing in Kendo UI for jQuery | Telerik Forums

I have a Kendo UI data grid inside a modal dialog and the Page Message of 1 - 10 of 50 (for example) is not showing in the bottom right.

The reason is because the UI component does some internal calculations and decides to hide it if it deems the box is too small. So, to always you need to add the following to the Pageable() section. Responsive(false) is all you need so that the component does not hide it!

.Pageable(pager => pager
           .Messages(messages => messages.Display("Records from {0} to {1} of {2}").Responsive(false))
        )
@(Html.Kendo().Grid<Models.Address>(Model.addresses)
        .Name("grid")
        .Scrollable()
        .Pageable(pager => pager
           .Messages(messages => messages.Display("Records from {0} to {1} of {2}").Responsive(false))
        )
        .Sortable()        
        .Columns(columns =>
        {
            columns.Bound(column => column.Id);
            columns.Bound(column => column.StreetAddress);
            columns.Bound(column => column.City);
            columns.Bound(column => column.Zip);
            columns.Bound(column => column.Id).ClientTemplate("<input type='button' class='k-button' onclick=\"location.href='./AddressEdit/#=Id#'\" value='Edit' />")
             .Title(" ");
        })
        .DataSource(ds => ds
            .Ajax()
            .PageSize(20)
            .ServerOperation(false)
        )
    )

 

Unable to pass more than 1 parameter using @Url.Action

From here: c# - Unable to pass more than 1 parameter using @Url.Action - Stack Overflow

Now the second parameter is passed in!!

$("#filesTemplate").kendoUpload({
	async: {
        autoUpload: false,
        saveUrl: "@Html.Raw(@Url.Action("Attachments_Save", "Upload", new { parentId, baseTableName }))",
        removeUrl: "@Url.Action("Attachments_Delete", "Upload")"
     }
});

 

 

Configure SQL Server to listen on a specific TCP port

From here: Configure SQL Server to listen on a specific TCP port - SQL Server | Microsoft Learn

If you have installed SQL Server 2022, you might find that you can't easily connect to the SQL Server remotely, even though you've set port 1433 as open in the firewall.

To fix this, open SQL Server Configuration Management. Note that if you have multiple SQL Instances on a single machine then you need to assign different ports. In my case I used 1433 for Production and 1434 for Development.

Assign a TCP/IP port number to the SQL Server Database Engine

  1. In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, select Protocols for <instance name>, and then in the right pane double-click TCP/IP.

     Note: If you have trouble opening SQL Server Configuration Manager, see SQL Server Configuration Manager.

  2. In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1IP2, up to IPAll. One of these entries is for the IP address of the loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP address on the computer. (You might see both IP version 4 and IP version 6 addresses.) Right-click each address, and then select Properties to identify the IP address that you want to configure.

  3. If the TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports, delete the 0.

    Screenshot showing the TCP ports.

  4. In the IP n Properties area box, in the TCP Port box, type the port number you want this IP address to listen on, and then select OK. Multiple ports might be specified by separating them with a comma. Select OK.

    If the Listen All setting on the Protocol tab is set to Yes, then only TCP Port and TCP Dynamic Port values under the IPAll section are used, and individual IP n sections are ignored in their entirety. If the Listen All setting is set to No, then the TCP Port and TCP Dynamic Port settings under the IPAll section are ignored, and the TCP PortTCP Dynamic Port, and Enabled settings on the individual IP n sections are used instead.

    Each IP n section has an Enabled setting with a default value of "No" which causes SQL Server to ignore this IP address even if it has a port defined.

  5. In the console pane, select SQL Server Services.

  6. In the details pane, right-click SQL Server (<instance name>) and then select Restart, to stop and restart SQL Server.

How to Turn off "Open File - Security Warning" message for a specific file

When running a file from a mapped drive you might get this error.

This is actually a Windows security message, intended to remind users not to open untrusted files downloaded from the Internet, but if you know that there is no security risk in the file, then such a message is meaningless.

 

I can guide you if you turn off this prompt, but please make sure that the source of all files downloaded from the Internet is secure.

 

  1. Search for Internet Options in the taskbar and open it.

  2. Click "Security" and then "Custom Level":

  3. In the displayed page, find "Launching applications and unsafe Files (not secure)", then click "Enable", then click "OK" to save the changes.

     

 

Now, you should not see this message anymore.

If you are a Windows User, I can actually recommend that you try changing the UAC (User Account Control) Settings.

Search for UAC in the taskbar and open it. Drag the slider to "Never Notify" and click "OK."

Once this is done, many user account control prompts will no longer appear.

Found here: How to Turn off "Open File - Security Warning" message for a specific - Microsoft Community

Shortcut Icon is blank when .ico file is located on a remote drive

You cannot use an ICO file that is located on a network folder (It must be on a local drive), otherwise it will not show. This is for a mapped drive or a UNC folder.

There are 2 ways to fix this issue. Group Policy or Registry entry.

Found here: Shortcut Icon blank when .ico file is located on a directory defined with an UNC Path - Microsoft Q&A

SOAP for VBA Upgrade

I recently had to upgrade an MS Access application from Office 2003 (MDB) to Office 365 (ACCDB). This application uses a SOAP connection to pull in XML from a Process Server in New York.

The original application was using MSSOAP30.dll in C:\Program Files(x86)\Common Files\MSSoap\Binaries\MSSOAP30.dll.

In order to upgrade the application, you will need to remove this MISSING dll and replace it with the new Office version.

  

Replace the Reference with the one shown below, found in C:\Program Files\Common Files\Microsoft Shared\OFFICE16\MSSOAP30.DLL.

OR this one for 32 bit Office.

C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16\MSSOAP30.DLL.

 

GMail for Apps

In order to use a Gmail account in an app, like a web app, you need to generate a password as described below. This is a 16 character password.

App Passwords required in Apps.

  1. Go to https://myaccount.google.com/security.
  2. Scroll down to "How you sign in to Google".
  3. Enable 2-Step Verification.
  4. Add App Password. You'll need to give it a name.
  5. Use the generated password in your code.

You can also use direct link https://myaccount.google.com/apppasswords

Exit single-user mode

How do I exit out of single-user mode? I don't have any user using this database. I was trying to restore a database from a different instance into a new database that I just created. Then I see it says it's in Single User mode after the restore failed.

The solution is this:

-- Start in master
USE MASTER;

-- Add users
ALTER DATABASE [my_db] SET MULTI_USER
GO

 

SQL Server principal "dbo" does not exist

You get this message when trying to create a SQL Database diagram

Cannot execute as the database principal because the principal "dbo" 
does not exist, this type of principal cannot be impersonated,
or you do not have permission.

After restoring a database from another server you see this

Solution

use [YourDatabaseName] EXEC sp_changedbowner 'sa'


503.0 – Server has been Shutdown

When developing an ASP.NET Core Web application, you MUST NOT call the CreateBuilder more than once! This should only be in the Program.cs file only. Otherwise, you will get this HTTP Error 503.0 - Server has been shutdown. This error might now show up right away but after a few clicks around then app where CreateBuilder is called, will result in this error.

The main issue with this error is calling the CreateBuilder more than once in the application. I used this to get to the Configuration file. Avoid this by using the IConfiguration interface on the Controller. You can also use a static class as well, for the other classes that can’t really inject an interface into. Also the static method is good for JSON calls! See below.

The problem is explained here: ASP.NET Core: 503 Server has been shutdown

This is how to use the Configuration: Configuration in ASP.NET Core | Microsoft Learn

Static Method

public static class AppExtensions
{
public static IConfiguration Configuration;
}

Then in Program.cs add the following line.
AppExtensions.Configuration = builder.Configuration;

Controller Method

For the Controller

public VersionsController(ModelDbContext context, IConfiguration configuration)
{
// Need to ensure that the connection is changed/set in the Constructor!
var id = AppExtensions.Connection;
var connectionString = configuration.GetConnectionString(id);
}

I discovered this method in this Stack Overflow post: c# - How do I access Configuration in any class in ASP.NET Core? - Stack Overflow