Most voted ".net" questions
The Microsoft . NET is a set of libraries and functions that are part of the Basic Class Library (BCL), such as user interface functions, data access, connectivity, cryptography, web development, mathematical algorithms, and network communication.
Learn more…2,689 questions
Sort by count of
-
2
votes1
answer63
viewsList only future items in C#
I have a database with a list of shows registered with location, date and time, but I need it to return me on the admin screen only the shows that will still happen instead of listing all shows…
-
2
votes2
answers567
viewsMethod that takes 3 integer values per parameter and returns them ordered in ascending order as an array
I can’t get the array filled returned be printed class Program { static void Main(string[] args) { int valor, valor2, valor3; Maior maior = new Maior(); Console.WriteLine("Digite um numero"); valor…
-
2
votes2
answers72
viewsDoubt about dll version
I’m having a problem with my Dlls A few screens is "System.ValueTuple.dll" My Packages.config is with the version 4.5.0. But when the project is compiled, it generates the dll with the version…
-
2
votes1
answer47
viewsError unable to access C#image collection
I am using Magick.NET to choose JPEG compression for my TIFF files. So, I save each one with this compression in a collection of images. Finally I want to join all the TIFF of the collection in one…
-
2
votes3
answers749
viewsFormat string for JSON
I have the following code: public static string SendSMS(List<string> numbers, string usuario, string message) { int count = 0; string keerpersNumbers = ""; string urlSMS = "https://minhaurl";…
-
2
votes1
answer1915
viewsError: Collection modified; maybe enumeration operation is not executed
I have a problem using the foreach to traverse a array of strings. This component is a search button to select files, it selects and writes the address of the file into a array of strings, i created…
-
2
votes1
answer95
viewsObject does not recognize member
All I do is in Python. One of the functions I have to do is a conversion, where she tries to convert the value of TextBox and if it goes wrong, run the error block. private void converter(object…
-
2
votes1
answer65
viewsCatching errors in Messagehandler
Hello I am trying to deal with errors in my application by making use of DelegatingHandler. But I have a problem, I used a try-catch to deal with errors. The try-catch encompasses the SendAsync,…
-
2
votes1
answer265
viewsCompute square root with input from typed text
I’m not getting the calculator to take the root of a number that the user types. The most I got was what is in the code, but regardless of the screen value, it only returns the root value of 2…
-
2
votes1
answer177
viewsHow to put a char variable in a string through the keys { }?
I’m doing an old-fashioned game, where there’s a function that prints it, and another that contains the 9 playable positions, I simplified the code so it doesn’t get too big and I just put a…
-
2
votes1
answer2713
viewsThe index was out of range. It should be non-negative and smaller than the collection size
I am creating a program that stores the profiles of all teachers online currently in a list and then displays the first 3 in a label (where a button advances by displaying the next 3 online), but…
-
2
votes2
answers98
viewsDropdown - ASP.NET MVC
I’m a beginner in ASP.NET MVC and I need to create a Dropdown in a vehicle registration form where I can choose only one driver related to the vehicle that is previously registered in the database…
-
2
votes0
answers36
viewsWhat is the best way to use Firstchanceexception in multithreading application?
I have an application (which is a Windows service) that currently runs N Threads. What I want to do is capture whichever error that occurs in the application to write to a log file '.txt'. Only I…
-
2
votes1
answer132
viewsRelationship one-to-Many Entity Framework
I am developing a crud of registration for a project. When registering the user(Employee) must inform a IdCity that is related to the table cities(Cities). How is it possible for me to automatically…
c# asp.net-mvc .net entity-framework entity-framework-6asked 5 years, 2 months ago vinilazzari028 23 -
2
votes1
answer224
viewsHow do I play the variable within a text in "Messagebox.Show" of a "case" on the "switch" command?
I’m doing a program interface on switch using C# to find out what a couple’s wedding anniversary is, only that I do not know how to insert the result variable for the case default if the marriage is…
-
2
votes0
answers127
viewsFetch request with ASP . Net Core 3.0
I am trying to replace the Ajax methods by Fetch in the application, but I cannot receive an object with Fetch, I made a small test object to try to receive, in Ajax, with you passing parameter…
-
2
votes1
answer311
viewsFraction sum problem in C#
Make a script to calculate and display the sum of the first "N" values of the sequence below. The value "N" will be typed (TextBox), should be positive, greater than zero, but less than fifty. If…
-
2
votes1
answer134
viewsHow to perform mathematical operation within the MVC view
I am creating a web application MVC 5 for studies and I have a question: it is possible to perform a mathematical operation in view? I wanted to multiply line 16. What would be the solution?…
-
2
votes1
answer367
viewsHow can I see the SQL generated by Entity Framework Core?
I am using version 3.1 of EF Core, and I am trying to see the SQL generated from this code: var query = Db.Set<Area>() .Include(i => i.Extratos) .Include(i => i.Coordenadas) .Where(x…
-
2
votes1
answer35
views -
2
votes1
answer44
viewsIs there a difference between Task.Fromresult and Task.Factory.Startnew?
Given a method in precise return a Task<T>. Example: public Task<MyResult> Handle(); I can make the following implementations: Thus: public Task<MyResult> Handle() { for (int i =…
-
2
votes1
answer81
viewsCondition does not work in a Setter method
Why does my code give the following error: The operator '>' cannot be applied to type operands decimal and double. Code: class Funcionario { public string nome { get; set; } public string…
-
2
votes0
answers50
viewsProcessing Data rs232
good afternoon! I need a help that would be another explanation in a certain way. I am doing homologation of an equipment that send data via rs232 however the equipment does not have a protocol that…
-
1
votes1
answer158
viewsHow do I test Htmlhelper, Ajaxhelper and Urlhelper methods?
I wrote some extensions for the MVC helpers. The problem is that I don’t know how to test these methods since I don’t have these objects in a test unit. How do I test the methods I created?…
-
1
votes2
answers1412
viewsHow to turn a DLL created in C# to VB6?
I created a very basic DLL in C# just for testing. It looked like this: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using…
-
1
votes1
answer145
viewsIs it possible to call the Executequery method asynchronously?
It is possible to execute the method ExecuteQuery asynchronously? Consider the following code: public virtual MyEntity MyMethod(string parm1, string parm2) { string queryString =…
-
1
votes1
answer170
viewsMake Sonarqube with Opencover ignore some C#classes
It is possible to configure Sonarqube with Opencover to ignore some classes of my project . NET?
-
1
votes3
answers2393
viewsXmldocument Exception: hexadecimal value 0x1a, is an invalid character
I have a project that reads an XML generated by another program in which I don’t have access to the source code. The problem is that the generated XML comes with a special character at the end, and…
-
1
votes2
answers1634
viewsHow to create reports in Cristal Report with data from 2 or more tables?
How do I create reports by Cristal Reports, using a Dataset that contains more than one Table? With a table I can work normal, but when I insert more than one table the result of the Report comes…
-
1
votes2
answers507
viewsWebclient request returns empty
In my program I need to get the contents of my site, but the return of the downloadString method of the Webclient object returns null. The most intriguing is that there is no exception, the status…
-
1
votes5
answers38715
viewsCalling a form and closing a form in the same event
How do I call one form and close a form at the same event. For example: private void iniciar_Click(object sender, EventArgs e) { Close(); Frm1 newForm2 = new Frm1(); newForm2.ShowDialog(); }…
-
1
votes2
answers60
viewsCan I override already existing anottation on . net?
I have the following Annotation: [XmlElement(IsNullable = true)] I’d like to see the code behind it, so I can create my own based on it Or if you can write her up…
-
1
votes2
answers65
viewsConsulting type passed via generic method
I have the following situation: public List<TEntidade> MeuMetodo<TEntidade>() { //My Code Here } Is there any way I can catch this guy from Tentity? The ultimate goal is to use this Type…
-
1
votes2
answers368
viewsOverride Xmltextwriter - Serialize Class for XML absolutely all attributes
I have my class: public class Pessoa { public int Id {get;set;} public string Nome {get;set;} } I’m trying to serialize for XML this class of mine. public static string CreateXML(object o) {…
-
1
votes1
answer161
viewsActivex Axvlcplugin2 no event works
I possess in my form a VLC Player. In it, I need to get basic information like video duration and current position. but no event works. Am I doing something wrong? Follow code: public Form1() {…
-
1
votes2
answers2473
viewshow to extract zip files in c# to a folder where system is installed
How to Extract Zip Files in c# to a folder where the system is installed? using System; using System.IO.Compression; using System.Windows; using System.Xml; namespace TestXml { /// <summary>…
-
1
votes1
answer1215
viewsProcess.Start(variable) to open an application without knowing the installation location
I have a Console Application that needs to call an application. Since I won’t be sure where it was installed, I need to assign the value to the path variable as below to get the application…
-
1
votes1
answer110
viewsWCF Restful Https for a Single Method
I have a WCF Restful that I am using for a mobile application, I need a single method, the payment, use HTTPS, I do not want to enable HTTPS for the entire service because some methods return a…
-
1
votes2
answers282
viewsRelate Check Boxes to Radio Buttons
I’m with a project where I have to put occurrences. This is a school project. So the occurrences would be like this: An occurrence would be a warning or a suspension, and its causes, that is, messed…
-
1
votes2
answers439
viewsHow to allow read-only for a certain type of user?
I have a button that triggers an event to close a school year. By clicking this button, the person can have access to all the screens of the system, but can not edit anything, delete, insert. Is…
-
1
votes1
answer1677
viewsDirect printing on the door
I need a VB.Net code to print directly to the port of a bead printer without using any driver windows. I add that my printer is connected by USB but in the future I needed to print on any type of…
-
1
votes1
answer13532
viewsC# Select and display in a combobox
I’m creating an application in C# windows Form and wanted to know how to select a table and display a list of clients in a combobox.
-
1
votes1
answer72
viewsTimeout Httpwebrequest Second time
public static bool Sinc(int v, out List<Ma> x) { try { XmlDocument urlData = new XmlDocument(); HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://192.168.1.155/Ser.svc/maq/?v=" +…
-
1
votes2
answers108
viewsBinding Linked Combobox Update
I’m working with the standard MVVM, so far so good, I have a class PessoaViewlModel. In it I own a property IEnumerable<Municipio> Municipios, in which he presents to me all the…
-
1
votes2
answers1122
viewsSqldataadapter Query with Parameters
I’m having difficulties in returning a query in the database using SqlDataAdapter with parameters. Well, I have a layered application in my View when I first access a GridView with a query (this…
-
1
votes2
answers300
viewsWhat can I use to replace the Hidden input in ASP NET MVC?
I have a difficult mission that is to pass a system of webforms to MVC, the system with webforms has many input hiddens that store basic information such as session hash and user code, but like me,…
-
1
votes2
answers1176
viewsWhy can’t I read a string on the console?
I’m trying to read a string typed into the console, which is halfway through the code, but what happens is it goes right through and displays the final information. using System; namespace Viernes {…
-
1
votes2
answers1224
viewsHow to fix this issue with Datagridview Check Box Cell?
I’m having a problem with the Datagridview checkbox Cell: Click on checkbox, and it marks the Checkbox and updates a value field. I click again, and he does the opposite. Everything works normally,…
-
1
votes1
answer270
viewsError publishing application in iis 8.5
I’m trying to publish an application made in Fluorinefx on IIS 8.5, I allow the MIME type .aspx, but when I access a page I have the following: Does anyone have any idea what it might be?…
-
1
votes1
answer1321
viewsEdit object list with POST form in MVC C#
I have the two classes below. I know how to make a screen to enter the data, and take the data from PERSON and PHONE, by model and for List. But how to do this on an edit screen? I want to show the…