40 Questions

Rashmi
Rashmi
Member
168 Points
34 Posts
I'm trying following c# code to parse date with string format "yyMMdd". var provider = CultureInfo.InvariantCulture; DateTime.TryParseExact("320918", "yyMMdd", provider, DateTimeStyles.None,out var dt) It's working fine if we are putting year 29 or less as "290918". And it's parsing as "18th Se ...
Views: 46
Total Answered: 1
Total Marked As Answer: 0
Posted On: 17-Sep-2021 20:01 
 
Smith
Smith
Participant
622 Points
141 Posts
I'm trying to generate GS1 data matrix code using https://zxing.net . I'm facing issue to generate separator and starting code.  I'm referring to doc: https://www.gs1.org/docs/barcodes/GS1_DataMatrix_Guideline.pdf var writer = new ZXing.BarcodeWriterPixelData { ...
Views: 210
Total Answered: 1
Total Marked As Answer: 1
Posted On: 21-Jul-2021 02:32 
 
beginer
beginer
242 Points
71 Posts
How to get Hours and Minutes as two digits with leading zero from DateTime object? I'm trying following code formulate the file path: var filePath = $"{DateTime.UtcNow.Year}/{DateTime.UtcNow.Month}/{DateTime.UtcNow.Day}/{DateTime.UtcNow.Hour}/{DateTime.UtcNow.Minute}/{Guid.NewGuid()}"; But it' ...
Views: 272
Total Answered: 1
Total Marked As Answer: 1
Posted On: 07-Apr-2021 06:00 
 
beginer
beginer
242 Points
71 Posts
I'm trying following code to scaling image: public static Image ScaleImage(Image image, int maxWidth, int maxHeight) { var ratioX = (double)maxWidth / image.Width; var ratioY = (double)maxHeight / image.Height; var ratio = Math.Min(ratioX, ratioY); var newWidth = (int)(image.Width * rat ...
Views: 221
Total Answered: 1
Total Marked As Answer: 1
Posted On: 16-Mar-2021 08:13 
 
beginer
beginer
242 Points
71 Posts
I have .net core api application when running on IIS or Kestrel Server getting correct locale and culture. But when running on Linux container it's coming blank causing DateTime.Now.ToString("t") showing incorrect format. Using docker command as: FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 ...
Views: 250
Total Answered: 1
Total Marked As Answer: 1
Posted On: 08-Feb-2021 06:09 
 
beginer
beginer
242 Points
71 Posts
I'm trying to build docker image and even any docker command, getting following error: error during connect: This error may indicate that the docker daemon is not running. : Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json : open //./pipe/docker_engine: The system cannot find the ...
Views: 1446
Total Answered: 3
Total Marked As Answer: 1
Posted On: 01-Feb-2021 02:18 
 
Smith
Smith
Participant
622 Points
141 Posts
I'm using docker-desktop to build containerized image. Build getting failed at restore command in docker file. It's not able to download any package. It's happening in local build.
Views: 209
Total Answered: 1
Total Marked As Answer: 0
Posted On: 28-Jan-2021 06:18 
 
edx
edx
110 Points
35 Posts
I'm using WebRequest to consume/integrate REST api in .netcore project something like: WebRequest request = WebRequest.Create(url); request.Method = "POST"; request.Credentials = MyCredentialCache; try { WebResponse response = await request.GetResponseAsync(); } catch { } It's w ...
Views: 434
Total Answered: 1
Total Marked As Answer: 1
Posted On: 26-Oct-2020 00:36 
 
Jak
Jak
Member
404 Points
167 Posts
I'm using nlog with .netcore REST Api as: using Microsoft.Extensions.Logging; } catch (Exception ex) { Logger.LogCritical(-1, ex, string.Format("error occurred: {0}", ex.Message)); } But getting error as: An error occurred while writing to logger(s). (Input string was not in a cor ...
Views: 1082
Total Answered: 1
Total Marked As Answer: 0
Posted On: 30-Sep-2020 03:26 
 
edx
edx
110 Points
35 Posts
I have two collections User { "_id" : ObjectId("5f51dac5ea43442fa419ca1f"), "name" : "John b" } Role { "_id" : ObjectId("584aaca6686860d502929b8d"), "role" : "Admin", "userId" : "5f51dac5ea43442fa419ca1f" } I want to join two collection based on the userId (in role collect ...
Views: 4127
Total Answered: 2
Total Marked As Answer: 1
Posted On: 11-Sep-2020 05:35 
 
 Log In to Chat