Questions tagged as 'c#'

1
answer

Does not list database data correctly in ASP.NET View

The data was entered in the database, but in the View it does not show one of the fields. I've checked in SQL Server and it's all right, but the name field returns empty in view public ActionResult Index() { List<MovimentacaoVM>...
asked by 05.02.2018 / 16:48
2
answers

DropDownListFor with ViewBag and Dictonary returning null value

I would like everyone's help to help with the following problem: Theerrorhappenswhenheisstilldoingthefieldvalidations.Controller:publicActionResultCreate(){varvEmpresas=newDictionary<string,string>();vEmpresas.Add("Matriz", "Matriz");...
asked by 16.08.2018 / 21:55
2
answers

Rendering css when transforming view into string

I'm using the method: protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName = ControllerContext.RouteData.GetRequiredString("action");...
asked by 09.07.2018 / 15:06
1
answer

For with DateTime in Razor giving out of memory exception

I'm having the error out of memory, being caused by this Razor code in my cshtml file, and I can not identify where the problem is. @for(DateTime data = DateTime.Today.Date; data <= DateTime.Today.AddDays(7).Date; data.AddDays(1)) { @da...
asked by 25.01.2018 / 23:41
1
answer

How to dynamically align the margin of a label via windowns form code?

I have lblStatus that serves to assign 4 different values according to the query and each value has a different size, so there is no way I can sort directly by the position property. So I would like to set the direct position for the code...
asked by 01.12.2017 / 17:17
1
answer

The method or operation is not implemented C #

I can not identify the reason for this error, and I made other developments with this logic and it worked.    The method or operation is not implemented. Follow the code below: Method that starts values: private void linkLblStatus_L...
asked by 04.01.2018 / 13:32
2
answers

Asp.Net MVC - Select item from a DropDownList reflect the same selection in another DropDownList that contains the same selection items

I have 02 DropDownList fields that have the same items to be selected, ie: Camera 1 Camera 2 Camera 3 Camera 4 Camera 5 Camera 6 Summarizing in large part the registrations that will be carried out, selecting a DropDownList item...
asked by 28.04.2018 / 04:19
1
answer

What is this and when and how to use it? [duplicate]

I would like to know what this does and how and when to use it.     
asked by 22.04.2018 / 07:14
2
answers

Find out how many are older in Windows Forms application

I'm trying to do an exercise in C # using Windows Forms that are over 18 years old. The algorithm should read the age of 10 people. But when I run the program it lets me just type an age. public partial class idade : Form { int qtd...
asked by 12.06.2018 / 19:20
1
answer

Search for content from an online file

string nome, idade, valores; WebClient WEBC = new WebClient(); public void Exemplo() { valores = WEBC.DownloadString("https://pastebin.com/raw/r4GjhKQ3"); } I want to get the values of the name and age after the '=' of the 'values' varia...
asked by 17.06.2018 / 05:02