Questions tagged as 'c#'

2
answers

Number of variable parameters in C #

I know you can do this. But I can not seem to find it. How do I get a function to accept a variable number of parameters of the same type, similar to an array? So I can simply call it like this: UIMostra("Localização", "Informações Gerai...
asked by 07.02.2014 / 18:58
5
answers

How to connect Windows Phone to a SQL Server?

I would like to know how to access and receive data from a server from Windows Phone. Simply put: I have a PC and I want to access a document directly from my smartphone.     
asked by 25.02.2014 / 15:56
4
answers

ObjectCache to make a variable available to all users

I have an application in ASP.NET and would like to cache all users as if the variable were in the pool application and everyone had access, something other than the session that makes the section variable for each user. ObjectCache...
asked by 08.04.2015 / 15:47
2
answers

call function php in C #

As by C # in WindowsFormsApplication call a function from a php page and pick up the value from it, eg: page php: function retornar() { $valor = "aa"; return $valor; } In case I would like to call this page through C # and assign a val...
asked by 14.03.2017 / 16:04
2
answers

Accessing components from another Form

I have two Forms in my application. A Form for data from an engine that has the following fields: txtPotencia , txtTensao , and txtCorrente . I would like to access the values entered in these TextBox throu...
asked by 31.01.2017 / 13:54
2
answers

Compare current date with saved in database and return validation

I am developing a program where there is a 15-day trial period. When the user registers an account in the application, it takes the internet date and registers the current date and end date of the test period, which is 15 days after the curre...
asked by 01.06.2017 / 18:11
2
answers

Find consecutive numbers in a string in C #

I would like to know if there is a simple way to find consecutive (equal) numbers in a string, so that you can replace that string with a single value. For example: string input = "Abc111de2234"; string output = "Abc1de234";     
asked by 16.04.2018 / 21:21
2
answers

Catch only the return value on a dapper

Does a query return this? var teste = _connection.Query(sQuery.ToString(), par).FirstOrDefault(); Well, inside the var test I have this: UF = "MA" But I just want the MA . How do I get the dapper to return only the value?     
asked by 03.04.2018 / 20:05
2
answers

Unexpected result in using Parallel.ForEach

Next, I have a class that has a string list and the following structure public class Teste { private List<string> _codigos; public void InsertDB(string[] files) { _codigos = new List<string>();...
asked by 08.02.2018 / 14:09
3
answers

System.NullReferenceException in an attribute of type StringBuilder

What causes the error to occur? How to correct? Model: public class modelExemplo { public StringBuilder listNewsletter { get; set; } } Controller: public ActionResult funcaodeteste() { modelExemplo obj = new modelExemplo()...
asked by 25.10.2017 / 14:00