Questions tagged as 'c#'

3
answers

I need to validate a TXT layout in C #

I have a TXT file where I need to validate the number of characters in each column as per the layout of each document. Note: The documents are all in a single file *.txt In the second column is the document type "0000,0400,0430". Ea...
asked by 27.06.2016 / 23:04
1
answer

How to configure Web API with multiple Get

I need to provide in my web api three forms of query: First Get with all records "GetAll", the second GET by the id and a third GET with filtering options, sent by the client eg Name contains the letter " the "and address contains the word" brid...
asked by 15.07.2016 / 19:55
2
answers

Check if string starts with number

I need to check if a string starts with numbers. I want to do this using Regex in C # public static class StringExtensao { public static bool ComecaComNumero(this string str) { if (string.IsNullOrEmpty(str)) return...
asked by 27.07.2016 / 16:58
4
answers

How to display data from 2 tables in a grid?

I am developing an application using Windows Forms and wanted to be able to display data from 2 tables in a ggrid, by the SQL command I can do this SELECT SU.SUBCATEGORIAID, SU.NOME, SU.CATEGORIAID, C.NOME FROM SUBCATEGORIA SU INNER JOIN CAT...
asked by 21.06.2016 / 00:01
2
answers

Referencing class Syntax Razor C #

I have a class where I have saved a configuration key being key and value, however I need to get the value of that key and pass it to my cshtml page. I'm having trouble with this. I've already passed the class path, but I can not refer...
asked by 21.07.2016 / 14:33
1
answer

How do I set default properties for a variable that start with a specific text?

Is there any way to set the properties of a variable by default to the initials of variables? Something like public string obsUsuario { get; set; } , all of which start with obs default to the IsOptional property, (or / and oth...
asked by 25.11.2016 / 17:11
1
answer

Assembly reference error [closed]

I'm trying to add a reference to my project, but when I add and execute the project it has this error:    Could not load file or assembly 'WaitWindow',   Version = 1.0.6164.26027, Culture = neutral, PublicKeyToken = null 'or a   of its depend...
asked by 18.11.2016 / 16:40
2
answers

How to save program, database, or configuration file settings?

In my application, the admin user can make some settings, for example: Set whether you want to use certain product templates, or leave it open for the end user to type. Configure whether to use TIPE table, or whether NCM will be open for t...
asked by 18.10.2016 / 12:19
1
answer

How to optimize this code?

Is there a faster (performative) way of comparing the current value with the previous value (of the bank) with Entity Framework ? Instead of selecting Id by Id (as Discount property of the code below), check the array...
asked by 18.11.2015 / 20:08
1
answer

Is it possible to make a condition within a Select?

I'm running a query using Select , to select only the required fields and consequently to have higher performance. In my View user can choose certain fields to load My ViewModel public class CliViewModel { public b...
asked by 03.11.2015 / 18:18