Questions tagged as 'c#'

1
answer

state 'can not be assigned to - it is read only - Entity Framework

Follow the code: var resultado = db.Tabela .Where(l => l.Nome == "João") .Select(l => new { l.numero, l.cidade, l.estado, l.pais }); I know that in the database has "SP" value of the state field and I want to change th...
asked by 15.01.2017 / 02:41
1
answer

Transferring files over a network C #

I wonder if there is any way to transfer files on a local network without using the C # Socket Class? and in terms of performance what is the fastest method of transferring files on a local network?     
asked by 13.01.2017 / 20:05
3
answers

Calling a method once inside an event handler that is called several times?

I would like to know how I can ensure that a method is called once inside a Event Handler C #, whereas this Event is called several times. Example: //meuEventHandler é chamado várias vezes. meuEventHandler = (object sender, M...
asked by 24.01.2017 / 14:24
1
answer

How to convert Byte [] to Image in Xamarin MVVM?

How to convert an array from bytes to Image to Xamarin ? I'm returning an image that is with the string type through a WebApi and therefore I need to make it appear in the Image component.     
asked by 09.11.2016 / 14:16
2
answers

How to send an email without sending an attachment?

Hello, I have a question: I made a script to send email, but I would like that when sending it the user does not have to necessarily put an attachment (that is, leave the sending of the attachment not mandatory). How could I do that? Follow t...
asked by 21.09.2016 / 16:15
1
answer

How to do text truncation without cutting .Net words?

I'm trying in a number of ways to days but I have not been able to get this script to get the value of <h3> and return the text to it truncated. JavaScript: <script type="text/javascript"> function truncar() {...
asked by 27.09.2016 / 14:31
1
answer

How to make function to encrypt password in C #? [closed]

How to do function to encrypt password in C #? I want to get the password attribute and encrypt it. public String gravarCadastro(Cadastro cadastro) { string sql; int retorno; string resp; try {...
asked by 07.10.2016 / 19:58
1
answer

Write file to database with NHibernate

Is it possible to serialize and write database files with NHibernate? public virtual File Arquivo { get; set; } It does not let you map and did not want to write without using NHibernate to follow the pattern     
asked by 06.12.2016 / 13:41
1
answer

How to show error message?

I am developing a C # registry in Visual Studio and have created a method to add a new registry to the database. The method is as follows: public static bool Inserir(Usuario pUsuario) { try {...
asked by 09.12.2016 / 16:56
2
answers

SQL query for Linq mvc4 c #

I'm not very familiar with Linq and I'm having trouble turning this SQL query into linq, can anyone help me. I do join of 6 tables (I did not do the database. I have to work with it), what I'm hooked on is group by and having...
asked by 18.11.2016 / 12:29