Questions tagged as 'c#'

3
answers

Upload image to picturebox and write to database

I'm now in the part of the movies of the video club, where I have these fields. AndIwantedtouploadtheimagetothepicturabox(it'salreadyworking)andwhenImakeitnewitwillbesavedinthedatabase(Icreatedanimagefield).Isitpossible?ItriedtodoasIdofortxt...
asked by 21.05.2017 / 22:45
2
answers

How to ensure that the instantiation of a class is done only through the "using"?

I am creating a DLL with some database functionality (ADO.Net). It would be very convenient to ensure that the instantiation of connections is always only via using (block), so do not forget to call Dispose() / Close() . But...
asked by 12.03.2015 / 21:22
1
answer

Attempt to read or write to protected memory

I have an application in C# that connects to the Oracle database. For this the application makes use of NHibernate (a very old version) and Castle ActiveRecord . This has always worked, but now when I try to query the database I...
asked by 27.03.2015 / 12:48
1
answer

What are the Global.asax methods when triggered and good practices?

I would like to know what methods, when they are fired, and what best (good practices) apply to them?     
asked by 05.03.2015 / 18:44
1
answer

Button is triggered even disabled, what to do?

I have a linkButton that is disabled via server, like this: lkExcluir.Enabled = false; Code: <asp:LinkButton ID="lkExcluir" runat="server" Text="[Excluir]" Font-Bold="true" OnClick="lkExcluir_Click" OnClientClick="return confirm('Tem...
asked by 25.11.2014 / 13:04
2
answers

Lock / fade screen during postback

I know that to effect this blocking / fading effect I can use JavaScript or some AJAX component. I find this kind of care interesting to prevent the user from clicking on the same button several times, which can cause problems. In addition to...
asked by 26.11.2014 / 20:08
3
answers

Line break in email message

In my string mensagem , I would like to have a space of two lines, I already tried to use "/ n" and did not get the expected result. @{ var customerName = Request["customerName"]; var customerEmail = Request["customerEmail"];...
asked by 13.11.2014 / 13:23
2
answers

How to check if the file name has 16 digits?

namespace _06_Teste { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void cmdValidar_Click(object sender, EventArgs e) { foreach (Stri...
asked by 08.01.2015 / 14:00
1
answer

A little more about File.WriteAllBytes

How to display a progress by synchronizing the following function: File.WriteAllBytes(string path, byte[] content); This method should be called according to a System.Threading.Thread Ex: Thread wnd; string wnd_file; byte[] wnd_...
asked by 29.01.2015 / 22:56
1
answer

Remote validation preventing data editing

I am using remote validation to prevent repeated emails in the database, which works fine when I do some registration. The problem is that the remote does not accept the original registry value, and does not allow me to save the changes made to...
asked by 06.01.2015 / 01:52