Questions tagged as 'c#'

4
answers

Doubt about using the SPA Template of VS2015

I need to do a routine to send email, through a form I made, using the VS2015 SPA Template. I put two buttons, Cancel and Send. The question is not in the email code, but how to assign the Click of the button to my code in the Controller and als...
asked by 11.05.2017 / 14:21
4
answers

How do I use the F2 key to open another form?

I have the following code, but it enabled the ENTER (13) key to open the form, I would like to enable F2 , I already looked for ASCII tables everywhere and can not find the desired code. private void Form1_KeyPress(object sender, KeyPressEv...
asked by 23.09.2015 / 13:20
2
answers

What is a DataSet and what is its function?

Creating my first applications with a database (SQL Server), I make the connection by passing my string and using the SQLCommand class to pass the query. But by searching other sites, I see that access to the database is done via DataSet....
asked by 16.03.2018 / 18:47
3
answers

Convert decimal to ushort

I need to convert a decimal value to ushort in my application: Is there a possibility? If yes, how to convert? I tried to use Convert.ToInt16(value) , but it did not work. Example in console: static void Main(st...
asked by 01.02.2018 / 15:13
2
answers

Enum Value C #

I have a question regarding the following code snippet: public enum TipoPessoa { [System.Xml.Serialization.XmlEnumAttribute("1")] Fisica = 1, [System.Xml.Serialization.XmlEnumAttribute("2")] Juridica = 2 } or this: [System.Xml.Serializati...
asked by 21.09.2016 / 18:50
2
answers

I need to make a filter with linq on an entity, this filter should bring all the events for the next 90 days. Today's example: 11/01/2017 until 04/11/2017 (90 days) _con.SiteContexto.AsNoTracking() .Where(e => e.Data....).ToList();     
asked by 11.01.2017 / 19:00
4
answers

Why this division in class instantiation in C #?

In the book " Use the Head - C # , the author declares classes in a way that I did not understand their utility, according to example: public partial class Form1 : Form { Farmer farmer; public Form1 () { InitializeComponent(...
asked by 30.01.2017 / 18:55
2
answers

Syntax error in SELECT WHERE using ADO.Net parameters [closed]

Does anyone understand this error and get a solution? Code:OleDbConnectionConSelect=newOleDbConnection();ConSelect.ConnectionString=Properties.Settings.Default.dbInvoice;ConSelect.Open();OleDbCommandCmmSelect=newOleDbCommand();CmmSelect.Comm...
asked by 29.08.2016 / 18:09
0
answers

How to develop a Remote Access [closed]

I would like to develop a system that could connect a machine to another machine and give me full control of this 2nd machine, eg Team Viewer, Ammy Admin, Log me In. I would not like to do anything very advanced, just something that I would b...
asked by 25.02.2015 / 17:14
5
answers

I want to put the number of characters and put it even or odd

But my code is giving error. namespace Impar_ou_parr { class Program { static void Main(string[] args) { string NumLetras; Console.WriteLine("Digite uma Palavra: "); NumLetras = Conso...
asked by 10.01.2017 / 13:27