Questions tagged as 'c#'

1
answer

Text construction, performance question

I have a question regarding text construction performance, I have a large text (1000 lines) with formatting etc, in a summarized way (it's not this text but I'll use an example) I have 2 ways to construct it StringBuilder sb = new StringBuilde...
asked by 23.02.2018 / 15:53
1
answer

Dates Comparison c #

My question is the following.    Ineedtodisplay2statusesonapagethatwouldbePrimeiroandAlterado,wherethefirstlineofsqlwiththedateof2018-03-0510:24:55.787receivesstatusPrimeiroandthesecondlineofsqlwithdate2018-03-0510:30:09.727receivesstatusAlt...
asked by 05.03.2018 / 15:14
1
answer

Change the color of a navigation page

I have this: public void Login_Clicked(object sender, EventArgs e) { LoginService svc = new LoginService(); LoginRS res = svc.Login(txtUsuario.Text, txtSenha.Text); if (res != null && res.Su...
asked by 08.02.2018 / 13:55
2
answers

Add a checkbox column in the datagridview

How to add a CheckBox type column in DataGridView? I need to do this for the user to select the row of the DataGridView with the CheckBox and then click the Save button. private void btnRestricao_Click_2(object sender, EventArgs e)...
asked by 13.02.2018 / 16:46
1
answer

Entity Framework lambda with include return empty collection

I have a select that returns chained data and plays them in a ViewModel created for the simple reason that I can not return all the data in my table, as in the example: var data = _context.Forms .Include(i => i.OrganizationUnit) .Include(i...
asked by 14.02.2018 / 23:52
5
answers

Validate model before entering bank

I'm developing a WebAPI using EntityFramework6. Before performing an INSERT in the database, I would like to validate the model that is coming via the request (I believe it is fundamental), but I do not have experience with good data validati...
asked by 09.02.2018 / 16:07
1
answer

Error: C # The name 'Json' does not exist in the current context

I have the following error in C # ' The name' Json 'does not exist in the current context ' in my application. I followed all the steps recommended by various sites, such as adding such references and such, but the error continued. using Syste...
asked by 07.02.2018 / 13:18
1
answer

Why add a variable, property, method, etc. in a string does it work?

When I add a variable, property, method, enumerator, etc. in a string , it works, even though I do not call the ToString() method for example. Example with type and integer: var example = typeof(bool); var exampleInteger = 12; Con...
asked by 13.02.2018 / 19:49
1
answer

Consuming a Web Service Asp .Net application Xamarin

I want to make a request to a Web Service developed in Asp. Net passing two parameters to my server. The controller in the web service is this: public HttpResponseMessage Get(string id1, string id2) { try {...
asked by 18.06.2018 / 14:40
1
answer

Make a query using Entity Framework and Stored Procedures

I have the procedure procRetornaCliente that receives the following parameters: Id, areaAuthentication, City. Mapping it to EDMX, I got a Complex Type ( procRetornaClienteModel ) with all fields mapped, but I do not know how to make a quer...
asked by 03.07.2014 / 14:45