Questions tagged as 'c#'

4
answers

How to convert the fields to a row with string?

Follow the code: Model: public class Usuario { public string Campo1 { get; set; } public string Campo2 { get; set; } public string Campo3 { get; set; } public string Campo4 { get; set; } public string Campo5 { get; set; }...
asked by 27.04.2017 / 20:42
1
answer

MSBUILD - How to publish multiple projects from a single Solution (OSGI)

I need help to publish my projects. I am using OSGI to modulate my application, consequently in my solution there are several WEB applications.    Ex: Solution A 1. Aplicação 1 2. Aplicação 2 3. Aplicação 3 4. Aplicação Principal Th...
asked by 06.06.2014 / 15:15
2
answers

How to get Id on the return of a Post in the Api Web?

I have this code in Web Api : [ResponseType(typeof(Menu))] public async Task<IHttpActionResult> PostMenu(Menu menu) { if (!ModelState.IsValid) { return BadRequest(ModelState); }...
asked by 07.06.2014 / 00:29
1
answer

RSACryptoServiceProvider - Decrypt

Using RSA encryption, I pass the encrypted data from the client to the server decrypt. When trying to decrypt, it gives me an exception CryptographicException with the message:    Invalid flags specified. I have no idea Flag ma...
asked by 17.06.2014 / 15:24
2
answers

Why does the unreachable error detected in C # occur? [closed]

public Boolean LogarUsuario(string Pnome, string Psenha) { using (OleDbConnection conexao = new OleDbConnection(Conexao.stringConn)) { conexao.Open(); cmd.CommandText = "SELECT * FROM Usuario WHERE...
asked by 12.01.2016 / 16:58
5
answers

Write ComboBox C # values in the database instead of descriptions

I have a screen in a simple registry form, where it has some combobox. I set your values manually. EX; In a combo that will register the access profile of a user, I have in this combo the option 1- Limited, 2 - total. However, how do I make t...
asked by 20.02.2017 / 00:44
3
answers

How to handle a KeyNotFoundException?

I have a question, I tried to find some content in Google but I did not find it. I have a block try catch as follows: try { //código string idFormaPgto = Dictionaries.FormaPgto[_order.FK_PEDIDOS_FORMA_PAGAMENTO]; //restan...
asked by 08.08.2018 / 14:43
2
answers

Instantiate class with static method

namespace Classes { class Program { static void Main(string[] args) { Editora ed = new Editora(); Program p = new Program(); ed = p.EntradaDeDados(); ed.InserirProvedorSql...
asked by 11.03.2018 / 07:02
2
answers

How to restrict a set of a property?

I have the following property in my class: public char Naipe { get; set; } This property can only receive one of the following values: (char)9824 (Espada) (char)9827 (Paus) (char)9829 (Copas) (char)9830 (Ouro) These are Unicode deci...
asked by 16.12.2017 / 16:13
2
answers

Print elements from a list

Is there a way to read the values that are in a list and display them in the console? I tried it like this, but it does not work Console.WriteLine(lista);     
asked by 14.06.2017 / 18:19