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
-
1
votes1
answer48
viewsError after performing Migrations (backend .Net)
My backend is built in . NET, and when including a certain table in the solution, I appeared the following error: Cannot create more than one clustered index on table 'dbo. Favorit'. Drop the…
-
1
votes1
answer53
viewsCast shapes with interface
wanted to know what are the possibilities (but which one is more suitable) to do a cast with interface. public class ClasseTeste1 : IMinhaInterface { ... } public class ClasseTeste2 :…
-
1
votes3
answers1521
viewsCannot implicitly Convert type 'string' to 'int'
protected void btnSave_Click(object sender, EventArgs e) { List<ProdutoAmortizacaoCreditoDias> aDay = new List<ProdutoAmortizacaoCreditoDias>(); ProdutoAmortizacaoCreditoDias ee = new…
-
1
votes0
answers39
viewsWhen is it necessary to use GC.Collect()?
I know that in . NET/CLR, the Garbage Collector acts alone, without it being necessary to call him manually. There are cases where the Garbage Collector does not "collect" automatically? When it is…
-
1
votes0
answers97
views -
1
votes1
answer95
viewsPopulating Textbox in different form with Datagridview data
I am trying to add the data from one line of a Datagridview from one form to another by clicking on a "confirmation button", but by the searches I did in other similar cases, the code is correct.…
-
1
votes1
answer96
viewsReadline does not ask for data typing
static void Main(string[] args) { Console.WriteLine("ESCOLHA UMA OPÇÃO"); Console.WriteLine("-----------------"); Console.WriteLine("1-Encriptar"); Console.WriteLine("2-Decriptar");…
-
1
votes1
answer80
viewsCreate controls dynamically in WPF
I need to create checklists that depend on previous inputs and processing. How do I create these "checklists" dynamically in WPF? (a code snippet, please).
-
1
votes1
answer430
viewsSpend Tempdata
Good afternoon guys I’m having the following problem, I need to pass a variable to another controller and I’m trying to do this by Tempdata, follow the code: var user = User.Identity.GetUserId();…
-
1
votes1
answer111
viewsProblems Converting Session to Class in C#
I have the following variable List<MyFile> xmlDisponivel = new List<MyFile>(); This variable is a list of the following class public class MyFile { public string FileName { get; set; }…
-
1
votes1
answer284
viewsIn this case use switch or if?
I have an exercise to do which consists of the following: The user informs the salary, and depending on the amount informed, he earns an increase according to the table. Example: From 1000 to 1500…
-
1
votes2
answers730
viewsClass with method to change a parameter
I have a User class with private attributes like Nome, Endereco and Telefone. This class has a constructor method that takes parameters such as nome, endereco and telefone. I would like to use a…
-
1
votes2
answers154
viewsExplanation in constructor method
I have some questions about the method of constructing a class that I am seeing as an example, if anyone can explain thank you. private static IList<Categoria> categorias = new…
-
1
votes1
answer53
viewsData query in a datagrid (registration program)
The problem I’m having is that I don’t how to display in datagrid only the name of the users to be possible to query each registration in this database when selected, and then displaying all that…
-
1
votes1
answer83
viewsChange Aero application color
How to change the application color . NET/Forms in the Windows Aero taskbar?…
-
1
votes0
answers59
viewsAngular sending data with token
Personal a doubt that for many it is very basic, but I did not understand yet, I have an application on . net and one in angular receiving the token, the two are OK with the Token storage and the…
-
1
votes1
answer184
viewsWould it be right to use a static class to consume a web service?
A question that occasionally arises when I am programming is related to the use of static classes. To official documentation Microsoft says the following regarding static classes: A Static class can…
-
1
votes2
answers907
views -
1
votes1
answer536
viewsshow Exception error on return of AJAX call
I have this call ajax: $.ajax({ method: "GET", url: "/Shipper/getFullAddress", data: { postalCode: value }, dataType: 'json', success: function(data) { $('#AddressStreet').val(data.AddressStreet);…
-
1
votes1
answer46
viewsValue is not added to a variable within a function
I’m doing a simple quiz show with questions and answers, with punctuation. My problem is this: I made a function so that every time the answer is right, +1 will be added to the score variable.…
-
1
votes0
answers90
viewsReceive table content by Webbrowser?
I have the following table. <table class="table1"> <tbody> <tr> <th></th> <th>SEQ</th> <th>LOGIN</th> <th>WHATSAPP</th>…
-
1
votes0
answers16
viewsUse full class name or import?
My question is this:: if I’m going to use a specific class only once in a location, I should import all of it up there in the code? Example: Suppose I want to get some information from web.config in…
-
1
votes1
answer643
viewsI can’t get functions from the System.Management class
I am unable to call some functions of the System.Management class; for my program. I’ve tried to put using System.Management; or System.Management.ManagementObject but it also doesn’t work. Code:…
-
1
votes1
answer50
viewsDoubt with DATAPICKER
I am using Datapicker and would like to ask a question about just enable a specific day. <script> $(function () { var datepicker =…
-
1
votes1
answer318
viewsEntitystate - How it works
What would be and what is the Entity Framework Entitystate for? When can it be applied? Someone has some example of why to use it?
-
1
votes1
answer143
viewsExecute mongoimport command via c#
I need to execute mongoimport command from mongoDB via code but not for sure: `pro.FileName = "cmd.exe"; //pro.UseShellExecute = false; pro.Arguments = @"/k cd C:\Program…
-
1
votes1
answer4621
viewsHow to create a . bat to run network file
bat that is locally on a network of multiple computers, one has a record label and the others do not, the one that does not have the record company I use one . bat with the following code via local…
-
1
votes2
answers1605
viewsHow to configure the Connection String in App.config?
I would like to mount using saved String: InstanciaSQLServer, UserSQL and PWSQL, it is possible that? Example of my app.config <configSections> <sectionGroup name="userSettings"…
-
1
votes1
answer427
viewsList web file folder
I’m trying to list a folder of files, I’m not getting, the error says that the directoryinfo does not support URL. DirectoryInfo directoryinfo = new DirectoryInfo("http://127.0.0.1");…
-
1
votes1
answer26
viewsReturn of Service
I am with the following problem, I make an ajax call to my service and it returns me a paged list everything ok.. And I have a button where I download to excel, only because it is a very heavy table…
-
1
votes1
answer88
viewsRun a program with internal arguments
How is it possible to create a Process, enter it without allowing any user to view the arguments? Ex: Executable: Mygame.exe Arguments: -userid 0 -userpwd 0 but without allowing the task manager or…
-
1
votes0
answers52
viewsSort Metrogridview content by clicking on the Heder title of a particular column
Hey, guys, I got a problem, I’ve been fighting for a while. I am using in my application Metroframework and Linq,and noticed that Metroframework does not have certain properties or that they do not…
-
1
votes1
answer573
viewsDo not reload page when giving Submit in modal
I have a modal to research customers: Which is called a registration form as follows: $('#linkSearchShipperCustomer').on("click", function (e) { showDialogList("@Url.Action("IndexShadow",…
-
1
votes1
answer96
viewsMigrate from VS 2005 to 2012 - Change framework version
I have a project compiled in . Net Framework 2.0, using VS 2005. Now I’m migrating it to VS 2012. The migration was successful, but the project was not recompiled for . Net Framework 4.5. My need is…
-
1
votes1
answer52
viewsHow to return warning in a View if there is no data to display?
I created the code below that generates a list. It checks whether the list contains any data saved in it or not. If you have data, returns a View with the list inside, if you have no data, returns…
-
1
votes0
answers128
viewsRequest for ASP.NET MCV super slow
I have a complicated problem with my project, and I don’t know what else to do. I have an MVC4 project (after an upgrade of the MVC3 project that the company I work for already had) and it is…
-
1
votes1
answer87
viewsSingle entry on Asp.net form
I have a code that registers certain types of equipment, the form fields I have are: Name, Server, Type and Port of the equipment. I wish it was not possible for the user to register two equipments…
-
1
votes2
answers2537
viewsHow to Read and Convert . xsd Extension File to a C#Class
How to Read and Convert . xsd to a C# class for this purpose and convert the schema of the site Sefaz to can generate an xml with correct schema to be able to emit NFE.
-
1
votes1
answer80
viewsRecover Sqlcommand as string
I need to recover a BD information with a select and compare with what the user is typing if it is different information, I allow the Insert. If the comparison is the same I do not let insert and…
-
1
votes1
answer398
viewsHow to cancel the execution of a function in C#
I am developing a C# WPF desktop application in which there is a function responsible for sending email EnviarEmail(), when this function is executed it takes a certain period of time for it to be…
-
1
votes2
answers282
viewsSum the random data
I have a code for a dice roller. Then the person will enter in the field the amount of data that will roll and after that the program will run the amount of data and add. So I made a array to…
-
1
votes2
answers68
viewsViewmodel with INSERT in two controllers
I own two Controllers: 1 - Register the CPF (CPF, Name) 2 - CPF Phone Registration (CPF, DDD, Telephone) Viewmodel: using System; using System.Collections.Generic; using…
-
1
votes1
answer426
viewsRijndael encoding based on 64 in C#
I’m doing a Rijndael encryption and I imagine I’m close to finishing it, but when I decrypt I’m in error: Invalid length of data to be decrypted. using System.Text; using static Array; class…
-
1
votes4
answers708
viewsConversion of interface list into object list: (List<Interface> in List<Object>)
I need to convert a IList<Interface> in a List<Objeto>. Take the example: public interface IObjetosBase { IList<IObjetosBase> get(); } public class ObjetosBase : IObjetosBase {…
-
1
votes1
answer65
views -
1
votes2
answers1578
viewsHow to change position of all matrix elements by changing the row number by the column?
I tried this algorithm but the result is the same after this exchange int[,] array = new int[10,10]; for (int l = 0; l < 10; l++) for (int c = 0; c < 10; c++) { int temp = array[l, c];…
-
1
votes1
answer160
viewsBuild XML File Tip Using xml Serializer - More Efficient Way
I am mounting an XML file whose structure should be have nested tags as the image below: The image above is the output for the code below: public class Feeder { public string Name { get; set; }…
-
1
votes3
answers62
viewsMemory and processing - Variables and verification
Is there a big difference for memory and processing in how to perform the verification in these two examples? If yes, why and how they both behave when executing the codes. Method 1: var exam =…
-
1
votes1
answer616
viewsWhat is the difference between Getkeystate() and Getasynckeystate()?
I’ve always used the GetKeyState() to know if the user is pressing a key, but I see that many people use more the GetAsyncKeyState(). With that came to me the following doubts: What is the…
-
1
votes0
answers35
viewsOpen Gridview2 by selecting a Gridview1 field
Hello. I’m trying to get every time I select a specific field within the Gridview1, open related data in an Access Database on Gridview2. That’s the code on my page. <%@ Page Title=""…