Questions tagged as 'c#'

2
answers

Populate DataSet with DataTable

In C #, how do I declare and populate a DataSet with a DataTable? My idea is to pass the resulting data from a query in the Database to the DataSet, then fill a Report with that DataSet. Is it possible?     
asked by 10.10.2014 / 15:02
2
answers

How to save and retrieve all Sessions of a user

I'm developing a system in which I need to recover all users logged in or logged on to the server. Context: When the user logs in to the system, in addition to creating the session , I save the information with the logon date and session tim...
asked by 28.10.2014 / 19:34
2
answers

Decimal variable removing the decimal places

I have a variable in decimal that receives a value from a textbox , but when this variable receives the value with decimal places it removes the decimal place and stores the value without it. p> What happens: TextBox value: 2.5;...
asked by 27.01.2015 / 13:15
2
answers

Different databases for the same application asp.net C #

In a club management system each club has its own database. There is a DAL class where it is in charge of getting the web.config to string from application connection . How to ensure that the login application loads the correct...
asked by 15.01.2015 / 14:17
3
answers

Time Throwing (Threads)

What you need to answer the question is in comments in the code: using System; using System.Threading.Tasks; class Program { static void Main(string[] args) { player1.Start(); t.Start(); while (t.IsAlive); //...
asked by 27.12.2014 / 21:17
1
answer

Recommendations for comments in an interface and its contracts

Every day I come across this situation when I insert comment for an interface and for a class. I am in doubt whether to use the same interface comments and their contracts in the class and its methods. I have already done a lot of research on...
asked by 19.02.2015 / 12:58
1
answer

Get Page HTML and Send to Controller

Hello, I'm trying to get all the page html from the tag and send it to my controller, but I'm not getting it, it follows used code. function exportarExcel() { var url = '@Url.Action("ExportExcel")'; var html = $("body").html();...
asked by 18.10.2018 / 13:36
1
answer

What is the difference between these two types of standard definition? [duplicate]

In C # , when creating a new classe with some properties, I must set some default value for the created properties, 0 in case of a property of Current Balance . What would be the difference between the two following ways that rep...
asked by 17.10.2018 / 19:47
2
answers

Extract XML tags C #

I was able to get a tag, but I did not find a way to get a repeat tag and store each repetition in a list. XML Example <casa> <porta> <janela>Janela 1</janela> <janela>Janela 2</janela> &...
asked by 11.10.2018 / 13:44
1
answer

Foreach or is within an Anynimous Type C #

I am putting together a return of an Api in JSON , and the return I am in AnynimousType I believe that is how it is called, in it I name the variables as they will for Json, I needed to make a foreach to return the parcels, of a form o...
asked by 01.12.2018 / 06:29