Component starts with a lowercase character. Component names cannot start with a lowercase character

This short article shows you how to resolve the error “”Component ‘ewallet’ starts with a lowercase character. Component names cannot start with a lowercase character.” You get the error after adding a Razor component page.

Error        Component ‘ewallet’ starts with a lowercase character. Component names cannot start with a lowercase character.

It actually means your physical file cannot start with a small later. To resolve this issue, rename ewallet to Ewallet will do.

Posted in .Net, Cloud, Community, Computers and Internet | Tagged | Leave a comment

SQL Server read data using PowerShell

This article shows you how to retrieve data using PowerShell. This short article expect you to have basic knowledge of PowerShell. When you search the documents in Microsoft you will find this one https://docs.microsoft.com/en-us/sql/powershell/sql-server-powershell?view=sql-server-ver15&viewFallbackFrom=sql-server-ver15%2F%3FWT.mc_id%3DDP-MVP-36769. You will then install the module in PowerShell as follow.

> Install-Module -Name SqlServer

PackageManagement\Install-Package : The following commands are already available on this system:’Add-SqlAvailabilityD

atabase,Add-SqlAvailabilityGroupListenerStaticIp,Add-SqlFirewallRule,Backup-SqlDatabase,ConvertFrom-EncodedSqlName,Co

nvertTo-EncodedSqlName,Convert-UrnToPath,Disable-SqlAlwaysOn,Enable-SqlAlwaysOn,Get-SqlCredential,Get-SqlDatabase,Get

-SqlInstance,Get-SqlSmartAdmin,Invoke-PolicyEvaluation,Invoke-Sqlcmd,Join-SqlAvailabilityGroup,New-SqlAvailabilityGro

up,New-SqlAvailabilityGroupListener,New-SqlAvailabilityReplica,New-SqlBackupEncryptionOption,New-SqlCredential,New-Sq

lHADREndpoint,Remove-SqlAvailabilityDatabase,Remove-SqlAvailabilityGroup,Remove-SqlAvailabilityReplica,Remove-SqlCred

ential,Remove-SqlFirewallRule,Restore-SqlDatabase,Resume-SqlAvailabilityDatabase,Save-SqlMigrationReport,Set-SqlAuthe

nticationMode,Set-SqlAvailabilityGroup,Set-SqlAvailabilityGroupListener,Set-SqlAvailabilityReplica,Set-SqlCredential,

Set-SqlHADREndpoint,Set-SqlNetworkConfiguration,Set-SqlSmartAdmin,Start-SqlInstance,Stop-SqlInstance,Suspend-SqlAvail

abilityDatabase,Switch-SqlAvailabilityGroup,Test-SqlAvailabilityGroup,Test-SqlAvailabilityReplica,Test-SqlDatabaseRep

licaState,Test-SqlSmartAdmin’. This module ‘SqlServer’ may override the existing commands. If you still want to

install this module ‘SqlServer’, use –AllowClobber parameter.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21

+ … $null = PackageManagement\Install-Package @PSBoundParameters

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidOperation: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package]

, Exception

+ FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pa

ckageManagement.Cmdlets.InstallPackage

You will then hit the above error most of the time if you already have SQL Server installed. In order to resolve the error, you need to install using the below command

> Install-Module SQLServer -AllowClobber


You can the read the sql data using Read-SqlTableData like the one showing below.

> Read-SqlTableData -ServerInstance “MyServer\MyInstance” -DatabaseName “MyDatabase” -SchemaName “dbo” -TableName “MyTable” -TopN 3


Reference:

https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module?view=sql-server-ver15&viewFallbackFrom=sql-server-ver15%2F%3FWT.mc_id%3DDP-MVP-36769

https://www.sqlservercentral.com/forums/topic/read-sqltabledata-and-write-sqltabledata-is-not-recognized-as-a-cmdlet-name-fun/?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

SQL Server Money vs Decimal datatype

The article shows you why we should use decimal than money datatype in Microsoft SQL Server. At first let us look at money vs float. Let perform the arithmetic below.

DECLARE

@mon1 MONEY,

@mon2 MONEY,

@mon3 MONEY,

@mon4 MONEY,

@num1 FLoat,

@num2 FLoat,

@num3 FLoat,

@num4 FLoat

SELECT @mon1 = 100, @mon2 = 339, @mon3 = 10000,

@num1 = 100, @num2 = 339, @num3 = 10000

SET @mon4 = @mon1/@mon2*@mon3

SET @num4 = @num1/@num2*@num3

SELECT @mon4 AS moneyresult,

@num4 AS numericresult

You can see after the decimal point all the number is gone. Let’s do it again with Decimal datatype with replace the float in the above statements to Decimal (19,4).

You can see the indeed the float and decimal produced the accurate figure beside in float the does not round up to certain decimal point. Obviously, try to avoid using money datatype if you do not have SSAS running.

Reference:

https://stackoverflow.com/questions/582797/should-you-choose-the-money-or-decimalx-y-datatypes-in-sql-server

https://www.c-sharpcorner.com/article/pros-and-cons-of-money-data-type/

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

CTO September 2020 articles and resources

These are the good reads found in this month.

What is digital transformation? A necessary disruption

Digital transformations are lagging or even failing for several reasons, including poor leadership, disconnects between IT and the business, lagging employee engagement and substandard operations, according to a report from Capgemini Digital Transformation Institute and MIT Sloan School of Management.

https://www.cio.com/article/3211428/what-is-digital-transformation-a-necessary-disruption.html

Three Reasons AI-Powered Platforms Fail

Today, more than 37% of organizations have implemented artificial intelligence (AI) in some form, and it is estimated that by 2021, 80% of emerging technologies will have AI foundations.

https://www.forbes.com/sites/theyec/2020/09/14/three-reasons-ai-powered-platforms-fail/#9861a6e6a00e

DATA CLASSIFICATION AND YOU

There are several resources online as well as companies that specialize in the actual classification of data. The simple method is to place data within high, medium, and low sensitivity classifications.

http://thestartupmag.com/data-classification-and-you/?WT.mc_id=DP-MVP-36769

Resources:

Azure documentation

Learn how to build and manage powerful applications using Microsoft Azure cloud services. Get documentation, example code, tutorials, and more.

https://docs.microsoft.com/en-us/azure/?WT.mc_id=DP-MVP-36769

Humans of IT

https://techcommunity.microsoft.com/t5/humans-of-it/ct-p/HumansofIT/?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, CTO, Data Platform | Tagged , | Leave a comment

SET IDENTITY_INSERT ON not working

The articles shows you one of the possibilities that the SET
IDENTITY_INSERT [dbo].[Products1] ON is not working and still giving you error like the one below


The statements you issue as the one below.

SET IDENTITY_INSERT [dbo].[Products1] ON

INSERT INTO [dbo].[Products1] SELECT * FROM Products

SET IDENTITY_INSERT [dbo].[Products1] OFF

The above statement will not work. In order for SET IDENTITY_INSERT ON to work. You need to explicitly specified the column name especially the identity column(s). The working sample will be the one below and the ProductID indeed the identity column.

SET IDENTITY_INSERT [dbo].[Products1] ON

INSERT INTO [dbo].[Products1]

    ([ProductID]

    ,[ProductName]

    ,[SupplierID]

    ,[CategoryID]

    ,[QuantityPerUnit]

    ,[UnitPrice]

    ,[UnitsInStock]

    ,[UnitsOnOrder]

    ,[ReorderLevel]

    ,[Discontinued])

SELECT FROM Products

SET IDENTITY_INSERT [dbo].[Products1] OFF

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

An explicit value for the identity column in table ‘table’ can only be specified when a column list is used and IDENTITY_INSERT is ON (option)

This article shows you one off the options to eliminate the avoid error. In previous blog I show you how to turn off the identity, https://chanmingman.wordpress.com/2019/09/12/an-explicit-value-for-the-identity-column-in-table-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/?WT.mc_id=DP-MVP-36769, if you don’t want to turn off the identity column the you can use the method below. To show you this I use Northwind database. Duplicate the same structure as Products to Products1.

SET IDENTITY_INSERT [dbo].[Products1] ON
is what
you need to use.

SET IDENTITY_INSERT [dbo].[Products1] ON

INSERT INTO [dbo].[Products1]

    ([ProductID]

    ,[ProductName]

    ,[SupplierID]

    ,[CategoryID]

    ,[QuantityPerUnit]

    ,[UnitPrice]

    ,[UnitsInStock]

    ,[UnitsOnOrder]

    ,[ReorderLevel]

    ,[Discontinued])

SELECT * FROM Products

SET IDENTITY_INSERT [dbo].[Products1] OFF

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

SQL Service Integration Service (SSIS) Overview

This article shows you the resources and key points on what is SSIS and why you need it. Unfortunately, they are a lot of claimed DBAs in the organization do not understand what data integration is. As quoted by one of the resources below date integration is Data Integration is a process in which heterogeneous data is retrieved and combined as an incorporated form and structure. There are 3 good resources below showing you what is SSIS, Why SSIS and getting started. All the resources below tell you why is SSIS important. SSIS is very effective if you want generating reports without human intervention.

SSIS Tutorial For Beginners: Why, What and How?

Why SSIS?

  • Data can be loaded in parallel to many varied destinations
  • SSIS removes the need of hardcore programmers
  • Tight integration with other products of Microsoft
  • SSIS is cheaper than most other ETL Tools
  • SIS provides GUI to transform data easily
  • Build BI into a Data Transformation Process
  • Robust error and event handling

https://www.edureka.co/blog/ssis-tutorial/?WT.mc_id=DP-MVP-36769

What is Microsoft SSIS?

Why is SSIS Important?

SSIS is important because it provides the user with a platform to move data from one source to another. The user can extract data from sources like SQL databases, Oracle databases, DB2 databases, and Microsoft Excel files before exporting them to another location. Other data integration and extraction features make the transition more manageable.

One of the reasons why SSIS is so widely used is because of its versatility. The program’s support for a range of databases and its simple graphical user interface (GUI) help new users to complete transformations and data warehousing tasks. Users have complete control to design an ETL process around their own requirements.

https://www.comparitech.com/net-admin/what-is-microsoft-ssis/?WT.mc_id=DP-MVP-36769

SSIS Basics

An Introduction to Key SSIS Functionality

SQL Server Integration Services (SSIS) is a popular and mature tool for performing data movement and cleanup operations. In the Microsoft ecosystem, SSIS is one of the most common extract, load, and transform (ETL) tools in use today. SSIS is powerful and configurable, yet surprisingly easy to use.

https://www.sentryone.com/ssis-basics-guide/?WT.mc_id=DP-MVP-36769

Office Microsoft documentation

Install Integration Services (SSIS)

https://docs.microsoft.com/en-us/sql/integration-services/install-windows/install-integration-services?view=sql-server-ver15/?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged , , | Leave a comment

ML.NET Get started – C# Machine Learning

This article with the links, video and sample code get you started with ML.NET. M: is Machine Learning.

Get started link is here: https://dotnet.microsoft.com/learn/ml-dotnet/get-started-tutorial/create/?WT.mc_id=DP-MVP-36769

Video: https://youtu.be/t4dFQvrUo08/?WT.mc_id=DP-MVP-36769

Sample Code: https://github.com/chanmmn/ML.NET/?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

C# POST Request.Form

This article shows you how to POST to a legacy system that using Request.Form to read the POST data. When you click the link at the bottom on this article then you will get the code simulate to the one below.

public static void PostData()

{

    // Create a request using a URL that can receive a post.

    WebRequest request = WebRequest.Create(http://localhost:58520/GetData);

    // Set the Method property of the request to POST.

    request.Method = “POST”;

    // Create POST data and convert it to a byte array.

    //string postData = “This is a test that posts this string to a Web server.|KFH0346”;

    string postData = String.Format(“fpx_msgToken={0}&fpx_msgType={1}”, “KFH0346”, “01”);

    //from Webform site

    //string strfpx_msgToken = Request.Form[“fpx_msgToken”];

    //string strfpx_msgType = Request.Form[“fpx_msgType”];

    byte[] byteArray = Encoding.UTF8.GetBytes(postData);

    // Set the ContentType property of the WebRequest.

    request.ContentType = “application/x-www-form-urlencoded”;

    // Set the ContentLength property of the WebRequest.

    request.ContentLength = byteArray.Length;

    // Get the request stream.

    Stream dataStream = request.GetRequestStream();

    // Write the data to the request stream.

    dataStream.Write(byteArray, 0, byteArray.Length);

    // Close the Stream object.

    dataStream.Close();

    // Get the response.

    WebResponse response = request.GetResponse();

    // Display the status.

    Console.WriteLine(((HttpWebResponse)response).StatusDescription);

    // Get the stream containing content returned by the server.

    // The using block ensures the stream is automatically closed.

    using (dataStream = response.GetResponseStream())

    {

    // Open the stream using a StreamReader for easy access.

        StreamReader reader = new StreamReader(dataStream);

// Read the content.

        string responseFromServer = reader.ReadToEnd();

// Display the content.

        Console.WriteLine(responseFromServer);

    }

    // Close the response.

    response.Close();

}

At the server endpoint I have a webform with the code behind below.

protected void Page_Load(object sender, EventArgs e)

{

    string strfpx_msgToken = Request.Form[“fpx_msgToken”];

    string strfpx_msgType = Request.Form[“fpx_msgType”];

}

Reference: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-send-data-using-the-webrequest-class/?WT.mc_id=DP-MVP-36769

Posted in .Net, Cloud, Community, Computers and Internet | Tagged | 1 Comment

Your project does not reference “.NETFramework,Version=v4.7.2” framework

This article shows you one of the possible ways to resolve the error “Your project does not reference “.NETFramework,Version=v4.7.2” framework. Add a reference to “.NETFramework,Version=v4.7.2” in the “TargetFrameworks” property of your project file and then re-run NuGet restore.”

Delete the following folders in under the solution folder works for me.

  • Delete folder “packages”
  • Delete folder “bin”
  • Delete folder “obj”

Reference: https://stackoverflow.com/questions/52833741/your-project-does-not-reference-netframework-version-v4-6-2-framework-add-a

Posted in .Net, Cloud, Community, Computers and Internet | Tagged , | Leave a comment