Questions tagged as 'c#'

2
answers

How to take the zeros out of time?

I'm using a Label to receive the time of a video. The time I get from the video is double that comes in milliseconds, for example: 1555 = 1,555 sec. When I convert to TimeSpan the Label appears as follows: The code I'm using...
asked by 17.06.2016 / 03:35
3
answers

Return DB values via ajax

I have a screen where I should populate with database values using ajax. When I click the button to fill in the fields the following error appears:    Failed to load resource: the server responded with a status of 500   (Internal Server Er...
asked by 18.10.2016 / 20:13
1
answer

Improving bank connection problem with Visual Studio

Hello, does anyone know if I have any way to find problematic code in C # related to opening and closing database connections? I have an application that after a few hours processing a load while executing a select generates an idle time error (...
asked by 18.10.2016 / 22:02
1
answer

Format listview subitem

I have trouble setting the background color of the listview SubItem when returning query from the database. I need in column # 18, which will return values such as "Overdue" and "On Day", when the value returned is="Overdue" that subitem in colu...
asked by 28.06.2016 / 11:53
1
answer

EF Mapping for Variable Name Tables

I have several tables with the same structure, but with different names. Eg: CREATE TABLE 'log_historico_25072016' ( 'lhis_id' INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 'lhis_cvei_id' INT(10) UNSIGNED NOT NULL, 'lhis_sequencia' SMALLINT(5)...
asked by 26.07.2016 / 02:27
2
answers

C # ASP.NET - Get the last value of a Parameter from the Stored Procedure

I have a Stored Procedure that inserts different fields. But nevertheless there is that when being inserted I want to catch and put on the screen. It is inserted into the database in the following way: cmd.Parameters.AddWithValue("@nume...
asked by 05.05.2016 / 17:54
1
answer

How to generate excel batch files in MVC?

I need to generate separate Excel files. I tried doing a foreach foreach (var item in listExtracts) { DataTable table = Mytable; var grid = new GridView { DataSource = table }; grid.DataBind();...
asked by 05.05.2016 / 13:57
1
answer

Map class with json.net

Is there any way to map the properties of a class without using annotation JsonProperty of Json.NET The following structure shows two classes that inherit from the Bar class. However, the json name of the parent property (Bar) sho...
asked by 05.05.2016 / 20:14
2
answers

Deserialize array in Json

I'm accessing an API and the return is an array with latitude and longitude respectively. Unfortunately, I can not deserialize because it does not have properties in Json. How can I do to achieve this in C #? Return: [[-23.45317,-46.7071...
asked by 27.04.2016 / 09:13
1
answer

Convert UTF-8 string to standard C #

I'm downloading a string via WebClient() and I get a string with badly formed accents. Example:    {"fíddiesticks":{"id":4078584,"name":"FíddIesticks","profileIconId":946,"summonerLevel":30,"revisionDate":1475092874000}}...
asked by 28.09.2016 / 22:59