Wednesday, March 10, 2021

Tilde.

 Alternatively referred to as the squiggly or twiddle, the tilde is a character ( ~ ) on keyboards below the Esc (escape key). It is on the same key as the back quote that resembles a squiggly line. The graphic gives a representation of how the tilde character may appear when typed.

 

Where is the tilde key on the keyboard?

Below is an overview of a computer keyboard with the tilde key highlighted in blue.

 


 

How to create the ~ symbol

Creating the ~ symbol on a U.S. keyboard

To create the tilde symbol using a U.S. keyboard hold down Shift and press ~. This symbol is on the same key as back quote ( ` ), in the top-left portion of the keyboard under Esc.

Creating the ~ symbol on a smartphone or tablet

To create a tilde on a smartphone or tablet's on-screen keyboard, tap the numbers button (123), then the symbols button (#+=). Then, tap the tilde (~) button.

 

Thank you.

 

Tuesday, March 9, 2021

Shortcut Key for Table Details in Sql Server Management Studio

 

Shortcut Key for Table Details in Sql Server Management Studio


If you select a table name in the query window of Sql Server Management Studio
and press ALT + F1 it will display the details of that table.

In the background shortcut key will execute sp_help on your behalf, so in this example it executes: sp_help users, which is much quicker than typing it.

I'm running Sql Server Management Studio 2018.



Thank you Hope it is help you.


Wednesday, February 24, 2021

How to fix error “ANCM In-Process Handler Load Failure”?

If you are getting this error:


This issue in .Net core 2.2. so one solution is for it checks the Dotnet-hosting version if you are you are using less than the 2.2.8 upgrade it into 2.2.8 version then the issue will be solved.
Hope it helps you.Thank you 




Wednesday, February 3, 2021

How can I call an async method in Main?

That kind if issue are facing beginner and those developer are not familiar with async and await used.
So in this post i have explain you how to call async method.

 
namespace PracticeHemaware
{
class Program
{
private static string result = "123";

static void Main(string[] args)
{
var data= Task.Run(async () => await saytest());
// saytest(result).Wait();
Console.WriteLine(data.Result);

Console.Read();
}
static async Task<string> saytest()
{
await Task.Delay(5);
result = "Hello World";
return result;
}
}
}
this is my code and saytest() is my async method.

Thank you.

Tuesday, February 2, 2021

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync

 Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync 

Error:
Full error is as below, while generating reports in Developer VM.

Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation) at

Reason:
Azure emulator service is not running due to port conflict with another windows service.
 
How to find what is running on what port?

using any of the below commands in cmd will give you list of the ports used by services.

netstat -bano

netstat -a

In my case, those ports were in use by windows application, which i can not stop or change port.

How to solve error?

To resolve this error open CMD with Administrative privileges

Navigate to location: "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\"

Execute command AzureStorageEmulator.exe start.

In my case service was not started due to same ports were being used by another application.

I have changed port number for Azure Emulator to run on different port and started service.

Below is Picturization for the same.


 

 

 

 

 

 

 

Thank you .

Upload Image To Azure China Blob Storage In ASP.NET MVC

 Upload Image To Azure China Blob Storage In ASP.NET MVC Code.
 1st step:-Use below code in web.config file.

<appSettings>
    <add key="StorageAccountName" value="YOURAZURECHINAACCOUNTNAME" />
    <add key="StorageAccountKey" value="YOURAZURECHINAACCOUNTKEY" />
  </appSettings>

The below is controller code

I am using service here the code are as below:-

using Microsoft.Azure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Web;

namespace BlobStorageDemo
{
    public class ImageService
    {
        public async Task<string> UploadImageAsync(HttpPostedFileBase imageToUpload)
        {
            string account = CloudConfigurationManager.GetSetting("StorageAccountName");
            string key = CloudConfigurationManager.GetSetting("StorageAccountKey");
            string imageFullPath = null;
            if (imageToUpload == null || imageToUpload.ContentLength==0)
            {
                return null;
            }
            try
            {
                StorageCredentials credn = new StorageCredentials(account, key);
                CloudStorageAccount cloudStorageAccount = new CloudStorageAccount(credn, new Uri("https://deice2staging.blob.core.chinacloudapi.cn "),
           new Uri(" https://deice2staging.blob.core.chinacloudapi.cn/ "),
           new Uri("https://deice2staging.blob.core.chinacloudapi.cn/ "), null);
                //CloudStorageAccount cloudStorageAccount = ConnectionString.GetConnectionString();
                CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
                CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference("blobstor1");

                if(await cloudBlobContainer.CreateIfNotExistsAsync())
                {
                    await cloudBlobContainer.SetPermissionsAsync(
                        new BlobContainerPermissions {
                            PublicAccess = BlobContainerPublicAccessType.Blob
                        }
                        );
                }
                string imageName = Guid.NewGuid().ToString() + "-" + Path.GetExtension(imageToUpload.FileName);

                CloudBlockBlob cloudBlockBlob = cloudBlobContainer.GetBlockBlobReference(imageName);
                cloudBlockBlob.Properties.ContentType = imageToUpload.ContentType;
                await cloudBlockBlob.UploadFromStreamAsync(imageToUpload.InputStream);

               imageFullPath = cloudBlockBlob.Uri.ToString();
            }
            catch (Exception ex)
            {

            }
            return imageFullPath;
        }
    }
}

and my UI code are as below :-


@{
    ViewBag.Title = "Upload";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Upload Image</h2>
<br />

@using (Html.BeginForm("Upload", "Image", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <fieldset class="form-horizontal">
        <div class="form-group">
            <label class="control-label col-md-2" for="Photo">Photo</label>
            <div class="col-md-10">
                <input type="file" name="photo" />
            </div>
        </div>
        <div class="form-group">
            &nbsp;
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Submit" class="btn" />
            </div>

        </div>
    </fieldset>
   
}


Thank you .

Hope it is help you

Thursday, September 10, 2020

Sign out azure in vs code

 I was using an app service in Visual Studio Code to access a certain set of subscriptions I was working against and deploying to. This was prior to getting my pipelines ready, as that was my eventual deployment destination. In the meantime, I needed to sign out the account and noticed there wasn’t any GUI way to do this in the Azure extension (that I could find anyway). I did some looking and found the process:

Start by opening the Command Palette:


Find the sign-out command:

You can now sign back in:

Enjoy!