Questions tagged as 'c#'

1
answer

Creation of a Header that is used in the communication of a WebApi

I am creating a program that communicates with a webapi and is giving me this error in creating the header. I'm using this to create the header: var tempo = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"); var httpWebRequest = (HttpWebRequ...
asked by 08.09.2017 / 17:55
2
answers

EntityFramework - new table was not created

Following this tutorial tables all correct. Then I went to do a test, I created a new entity, I made update-database and nothing to create the table in SQL Server 2012. I made some changes in the entity, added migrations , tried to...
asked by 18.08.2017 / 15:07
1
answer

Is it possible to know in which routes.Map () the call of an Action crashed? ASP.NET MVC5

Then # I have two routes.MapRoute() routes.MapRoute( "Home", "Image/{id}", new { controller = "Home", action = "Image", id = UrlParameter.Optional }, new { id = @"\w+" } ); routes.MapRo...
asked by 18.08.2017 / 18:03
1
answer

Determine the number of items in a list that are within the limits defined in another list

I have a ListBox that contains an undetermined value of values and I want to throw those values to a List<> and from what I researched, I managed to do so far: var todosValores = lstRoll.Items.OfType<object>().Select(...
asked by 25.03.2018 / 05:20
2
answers

TaskCompletionSourceTResult without a type parameter

The TaskCompletionSource<TResult> class needs a TResult type. That way, when I need to use this class without having a return type ( void ), I have to do something like: var tcs = new TaskCompletionSource<object>(); /...
asked by 08.11.2017 / 03:20
2
answers

ASP .NET MVC 5 - DropDownList with ModelState?

I'm developing a registration system using MVC5 with DAO , however there were some doubts that I could not solve. I have a table where I register Projects and another where the types of Projects are: Table: Projects Fi...
asked by 21.08.2017 / 23:42
1
answer

How to insert text into an existing PDF? [closed]

I have a contract template ready and with nothing filled. I need to fill in the requested information with what will be typed in some TextBox . How can I do this using iTextSharp?     
asked by 15.10.2017 / 22:01
2
answers

Date range C #

I have a table in the database named Quota, this quota has two columns one for start_date and end_date, so far so good, now I have another table called Order that also has start_date and date_fim, these tables are related 1 for N, one quota can...
asked by 11.08.2017 / 16:07
1
answer

How to read an excel file and do the mapping

I would like to know how I can read an excel file and then do the mapping to a datagridview. Code I tried: var fileName = @"C:\Users\HP8200\Desktop\test.xlsx"; var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileNa...
asked by 25.09.2017 / 11:22
1
answer

When to use And, AndAlso and Or, OrElse? [duplicate]

I do not know when to use the syntaxes Or or OrElse and / or And or AndAlso , because I do not understand what difference it makes in the logic circuit. Being in C #, And = & , AndAlso =...
asked by 24.09.2017 / 20:05