Questions tagged as '.net'

1
answer

Pass complex object vs simplest object per parameter

In the Log method there is the parameter of type HttpClient . The function only uses the parameter to access the property BaseAddress , which is a Uri . private void Log(string verb, HttpClient httpClient) { var ur...
asked by 09.11.2017 / 18:57
1
answer

I can not get functions from the System.Management class

I'm not able to call some functions of the System.Management class; for my program. I've tried to using System.Management; or System.Management.ManagementObject but it also does not work. Code: static string getid() {...
asked by 24.04.2017 / 14:54
2
answers

Ping on server with C #

Is there any .NET class with ping functionality? I have the IP of the server in an attribute of type String and would like to ping the server to see if it is online or offline. Does anyone know?     
asked by 20.09.2016 / 17:40
2
answers

Add AND and OR to Where de list

I have a list in C# and the search code is currently like this: filter = lst.Where(s => s.Contains(num.Text) ).Take(3).ToList(); The lst list is based on a list of phone numbers and contact names, for example: 123456789$nome1 9...
asked by 13.06.2016 / 20:53
2
answers

Object error not instantiated

I have a model named ClientesModel . Inside it I have the fields: public int id { get; set; } public int codcli { get; set; } public string nome { get; set; } public string endereco { get; set; } public string nr {...
asked by 22.04.2016 / 21:17
2
answers

How to implement and use the BinarySearch method?

How to implement and use the BinarySearch method of a List<T> ? I'm having difficulty implementing it and also how to use it in a practical way. Follow the example for illustration: int BuscaBinaria(List<string> lis...
asked by 23.12.2015 / 15:41
2
answers

Capture file name

I have a form that I look for the path of a file in .mdb (Access database), however I wanted to know how I can limit and exactly get the string of the file between the last bar of OpenFileDialog and the point of .mdb . S...
asked by 01.08.2016 / 15:26
1
answer

Generic class for CRUD

I have some common CRUD features in the database such as cadastrar , buscar um registro , buscar todos os registros , and excluir . For this, I am currently implementing a class manager each database table to perform the...
asked by 26.07.2016 / 14:58
1
answer

Precision scale using Entity Framework and SQL Server

I have noticed some strange time saving values double in the SQL Server database with the Entity Framework. I noticed that when reporting a value ex: 12.23 after saving the information is breaking the decimals in more houses ex: 12.225...
asked by 08.08.2016 / 22:22
2
answers

'system.outofmemoryexception' while opening 300 mega .dbf file

I try to open a 300mg .dbf file in my code, but this error appears '$ exception.Message' threw an exception of type 'System.OutOfMemoryException' , a smaller file of 300kb is opened normally, I know the file is too large, but I also know th...
asked by 23.10.2015 / 22:15