Questions tagged as 'c#'

2
answers

Two parameters with String.Format in an asp: HyperLink

I would like to send the parameters (ID of the database, ClientID) to a <asp:Hyperlink . I wanted the final result to be: <a id="ctl00" onclick="OpenModal(704520,'asdf_ID_DaImageAbaixo')"> <img id="ID_IMAGE" src="../onlin...
asked by 13.03.2014 / 16:43
1
answer

Convert.ChangeType converts data wrongly

The method Convert.ChangeType is converting the date in the wrong way I expect 24/02/2015 and comes 23/02/2015 . Does anyone know why? Code sample: using System; using System.Globalization; namespace ConsoleApplication4...
asked by 16.03.2015 / 17:56
2
answers

Send email using ASP.Net MVC

How can I send email using ASP.Net MVC? Do you have any option to send without specifying SMTP similar to mail() of PHP ?     
asked by 03.09.2015 / 22:20
4
answers

Printing Array of Strings in a Single MessageBox

I have a variable that is an array of string s and I want to print its values, but these values and consequently the quantity of them is only defined after the system works. How can I print in a MessageBox , for example, all valu...
asked by 24.08.2015 / 15:06
1
answer

Remove "OR" condition from LINQ query

I have the following method: bool naoUsarNomeCliente = String.IsNullOrWhiteSpace(filtro.NomeCliente); long codigoExterno; bool naoUsarCodigoExterno = !long.TryParse(filtro.CodigoExterno, out codigoExterno); bool naoUsar...
asked by 09.06.2017 / 21:05
2
answers

I can not read the values returned from the database using OracleDataReader

I'm having trouble reading the returned values from a select , on the line where I do: OracleDataReader reader = cmd.ExecuteReader(); In read it brings me the values correctly, but on the next line where I do reader.Read()...
asked by 14.05.2015 / 18:29
1
answer

How to display an ASP HTML code in a Label sending by Code-Behind (C #) - ASP.NET

I'm having a problem, I've done several tests where I'd like to send a HTML code directly to a label from a C # method, where it would dynamically display the code on the screen. But when I send it, it does not render. public partial class...
asked by 15.05.2015 / 02:21
3
answers

How to insert an existing record in the Entity Framework?

At some point in the system some records are selected and must be replicated by changing only one value. At this point I'm selecting the records that I need to insert: listaRegistros = listaRegistros .GroupBy(r => r.Id)...
asked by 15.05.2017 / 15:11
2
answers

Create an object of type Stream from a string

I need to create an object of type System.IO.Stream from the contents of a string . This my string is in a Resource.resx file. I retrieve it like this: string xml = ResourcesRel.pt_BR; I need to use a component that ha...
asked by 22.02.2017 / 20:00
2
answers

What is the difference between ToListAsync () and ToList ()?

What is the difference between ToListAsync() and ToList() ? As in the example below, what is the difference between one and the other? using Modelo.Classes.Contexto; using System.Data.Entity; using System.Linq; namespace AppCo...
asked by 05.12.2016 / 15:52