Questions tagged as 'c#'

2
answers

Error writing new record to the Access database

I'm doing a CRUD with Winforms in C # , I'm having an error inserting the date in the date field. The following message appears when attempting to write the new record:    Operator syntax error missing in query expression '10 / 02/1986 0...
asked by 24.10.2017 / 17:38
1
answer

Post office API request

I have a problem with my C # code, I am trying to consume the api of the mails but the data comes null, I found another tutorial on the internet that said to instantiate the class trace and get the property rastroJSON but my service does not hav...
asked by 04.11.2017 / 00:47
1
answer

ASP.NET Core Paging - PagedList.Core

I am creating an ASP.NET core study project, and when using the PagedList.Core paging library, the following error is occurring when running the dotnet run command:    Startup.cs (49.35): error CS0246: The name of the type or na...
asked by 09.09.2018 / 20:50
1
answer

Error return method "public async Taskstring"

When I execute the code below, it gives error in this line: Literal1.Text= ObterEmocoes(imageFilePath); You are giving this error message:    An object reference is required for the non-static field, method, or "Program.ObterEmocoes (str...
asked by 27.08.2018 / 03:16
1
answer

Scope configuration file saving directory with User C #

For configuration files in C # , I have always used App.config only to write connection strings and some read-only variables, but currently I needed to modify some data at run time, hence the scope issue: User and Application...
asked by 20.09.2018 / 19:36
1
answer

Access a list / array in a JSON URL

I am sending via JSON an array of strings, how can I access this array via url? example of some of the tests:    link    link {carrengado, erro} But it did not work, does anyone know how I can do this? [HttpGet] public HttpResponseMe...
asked by 19.09.2018 / 15:16
1
answer

How to create a Bitmap greater than 9999 pixels

When trying to create a Bitmap I realized that I can not create with the size I wanted, I need an image with 16581375 x 1 . > Bitmap image = new Bitmap(16581375, 1); image.Save("Path aqui"); As I try to run this code it returns me...
asked by 01.01.2018 / 18:19
1
answer

Entity Framework Core 2.0 - Add-Migration does not work

I'm creating a new code-first project. When trying to create the migration, using the [Add-Migration Initial -Context LogAuditoriaContext] command it simply does nothing, does not create, does not give error, does not report anything: I have...
asked by 27.12.2017 / 14:43
1
answer

Best practice targeting action result

I need to direct the administrator to one location, the first-time student to another, and the student you have / p> My validations are working, everything is working. However, I wonder if there is a best practice to apply for it: [Htt...
asked by 14.05.2014 / 20:08
2
answers

IF condition within _Layout.cshtml in MVC

I have two _Shared.cshtml (MVC masterpage type, I do not know the name) and both are pretty much the same, only the left menu is different. I would like to do only 1 and according to the querystring I will call the page I want to be th...
asked by 13.05.2014 / 19:11