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
-
0
votes1
answer37
viewsData from the same table for different views?
I have found it difficult to solve the following problem: Assuming I have the following structure in the database: Id int identity primary key CodigoBanco char(3) Descricao varchar(100) Endereco…
-
0
votes2
answers148
viewsOpen connection more than once in C#
I am developing a service in c#. calls a function to check if it has active records. if you have any record call another function to select the data referring to the first query. When I run my…
-
0
votes1
answer31
viewsIs there an alternative to the Outputcache directive previously used on . aspx pages, to be used on . cshtml pages in . net core?
Is there an alternative to the Outputcache directive previously used on . aspx pages, to be used on . cshtml pages in Asp . net core ?
-
0
votes1
answer28
viewsCompiling file . il (Intermediate Language) with admin permission
I’ve been doing a lot of research on how to insert certain parameters into an already created executable. And I arrived in that post of the Stack But the program initially has administrator…
-
0
votes1
answer143
viewsError: a property or an indexer that cannot be passed as an out or ref parameter
I’m having second thoughts about CS0206 Error Maybe a property or an indexer cannot be passed as an out or ref parameter on line 39 and 41 of my code, how do you solve this? 35| produtos[i] = new…
-
0
votes1
answer202
viewsSendkeys.Sendwait() is not working in a particular application
I have a software for my tcc, in which I am emulating the pressing of a key using the SendKeys.SendWait("{F12}"). I created the methods and everything right and went to test, however in the…
-
0
votes1
answer81
viewsDatabase connection object: Should I only have one for the whole system or one instance per class?
What is the best practice: to have only one point (Singleton) that returns the connections to the database or to create an instance of the connection for each object? My system accesses several…
-
0
votes1
answer198
viewsHelp to debug in visual studio
Is there any way in the visual studio from one breakpoint to another kind of thing that’s between them? I have a giant and complex system, which almost always gets as far as I want, and it is…
-
0
votes1
answer244
viewsHow to catch the monitor serial via code
I need to collect various information from monitors via code, I searched a little and found this link:…
-
0
votes1
answer35
viewsCapture checkboxes marked in a View
I’m listing my objects through a ViewBag sent to the View, and for each item there is a checkbox, and for each contract there is an Id: @foreach (var item in ViewBag.Contratos) { <tr>…
-
0
votes1
answer93
viewsX509certificate2ui.Selectfromcollection is closing the application
In a particular client, when accessing the function X509Certificate2UI.SelectFromCollection the application is closing without even passing the error handling. This function opens a Windows dialog…
-
0
votes1
answer73
viewsWCF services with a number of different methods (endpoints)
I took a project that uses WCF and I’m not getting to solve this mystery. I have two Solutions: Project A and Project B. When he tries to instantiate the OAuthServiceClient within the Project B, it…
-
0
votes0
answers68
viewsEntity Framework 6 catch attributes in Savechanges
I’m using the Entity Framework 6 with Oracle. The database is of a legacy system, I intend to set in hand the primary keys of the records. To make life easier, I want to take SaveChanges of…
-
0
votes2
answers161
views -
0
votes1
answer113
viewsWhat is the difference [email protected] vs 'Asp-controller' next to 'Asp-action'?
I am doing a project in ASP.NET MVC and I came up with this question, The Url.Action in a 'tag' (for example in a navbar) can redirect the page passing the method and controller as parameter.…
-
0
votes0
answers172
viewsError deserving JSON: The JSON value could not be converted to System.Collections.Generic.Ienumerable
var stream = await response.Content.ReadAsStreamAsync(); var des = await JsonSerializer.DeserealizeAsync<IEnumerable<WorkingDaysDates>>(stream); [JsonProperty(PropertyName =…
-
0
votes1
answer112
viewsCreate new directory according to string
I have a function that saves an image in a default directory, for all companies, and I tried to change this to save in a directory according to this string companyFolderwhich I have created. Yet you…
-
0
votes0
answers49
viewsI’m having trouble creating a public async method Task<Actionresult> Synchronous action method C# Web API
I am having this problem to create a method in the API does not recognize the Actionresult…
-
0
votes1
answer53
viewsPotentiation with array
I thought of the following code to calculate the square of each value in array: double []vetor = {1,2,3,4,5,6,7,8,10}; double result = 0; foreach(double posicao in vetor){ result = Math.Pow(posicao,…
-
0
votes0
answers40
viewsHow to execute a string’s instructions
I have a string: string str="for(int x = 0; x < 10; x++) Console.Write(\"hello\");" How do I execute the instructions for this string? for(int x = 0; x < 10; x++) Console.Write("hello");…
-
0
votes1
answer59
viewsIs CQRS login in Command or Query?
Hello, I will do Login in hand (would not use Identity or any other lib or service) I am using CQRS, I wonder if I should put the Login as Command or as Query, given that there will only be a logic…
-
0
votes0
answers26
viewsUpdate multiple databases with Entityframework
I have an application developed with React + API with . NET Core where I use Entityframework to run database migrations. The applications and databases (one for each customer) are all in Azure. I’m…
-
0
votes0
answers458
viewsError deserializing JSON (JSON array)
I looked for other topics related to this error, but I believe my case is a little different. Error: System.Exception: Error processing request: Cannot deserialize the Current JSON array (e.g.…
-
0
votes0
answers13
viewsPerform task after debug
I’m using Visual Studio Professional 2019, and I’m applying Transform in the Web.config, similar to that answer: https://stackoverflow.com/a/3994081/4720858 I understood well that it is possible to…
-
0
votes1
answer54
viewsC# How do published app use settings I changed in the app.config?
I have an app like Netframework Console, and I have the app.config in it. My app needs to use the tags from app config. that I change frequently to generate some text files, that is to say I have…
-
0
votes1
answer70
viewsRemove Background Checkbox Wpf Material Design
Folks I’m trying to leave the Checkbox only with the square mark and dash that says it’s marked. My code is this: <CheckBox Content="Teste"> <CheckBox.Resources> <SolidColorBrush…
-
0
votes1
answer98
viewsProblem with accentuated character in the return of the query
I have a Mysql database with encoding defined as latin1_swedish_ci. I’m using Dapper to connect the database. When I make a query to certain tables, the characters that are accented comes as follows…
-
0
votes1
answer47
viewsCorrect LINQ search syntax in MVC
I built an application with MVC that performs a query in an SQL database and returns it as a table, and now I want to add a search bar to that screen. I’ve already set up my "Index.cshtml" view…
-
0
votes1
answer34
viewsList of JS objects in the C# MVC Controller does not appear in the Request.Cookies
I’m putting the following Cookie: document.cookie = "Teste=" + '[{"Id":20,"Nome":"Prato Feito","Valor":12.5,"Quantidade":1,"Imagem":"/images/ImgEmpty/noImg.jpg","Descricao":"Batata Palha, Cebola,…
-
0
votes1
answer24
viewsDecimal value formatting . NET Framework
Considering the code below, how can I change the return of .7777 for 0.7777? using System; using System.Globalization; namespace Teste { class Program { static void Main(string[] args) { decimal x =…
-
0
votes0
answers13
viewsInterpret file . uni with VB.net
I have a file . ini with the following structure: [00000000000] parâmetro1=xxxxxxxxxxxxxxx parâmetro2=xxxxxxxx parâmetro3=xxxxxxxxxx and this pattern repeats itself for about 2000 times. I would…
-
0
votes1
answer30
viewsApplication . NET online + Offline
Is the following, there is today some form or tool that allows to record the data in an offline database in case the client’s internet falls? I will explain better, my application is Web, made in .…
-
0
votes0
answers224
viewsHttp Failure Response for (url): 0 Unknown Error?
I have a local code. The front (Angular 8) sends a POST request to the back (.net). On another computer it works normally. But in my current computer does not work. Returns: Http failure response…
-
0
votes0
answers37
viewsWhat are the attributes for and how do I use them?
I have the following attribute: class Program { [test] static void Main(string[] args) { } } class test:Attribute { } What can be implemented in the test class and what this implies in the main…
-
0
votes0
answers34
viewsThe option to create an ASP.NET Core web app does not give me the option to create an app with React
Good personal evening I’m having a "problem" in creating a new Web application ASP.NET Core. When I choose the . NET 5.0 option it does not appear that screen that has the option to create an app…
-
0
votes1
answer64
viewsHow to delegate UI methods automatically
I created these methods in the interface: public interface IEvents { void OnEscrever(string text); void OnEnable(bool b); void OnDisable(bool b); } I’ll have some classes that will inherit these…
-
0
votes2
answers669
viewsInvalid character in HTTP Request C#
I need to develop a Webapi that you pass a Query and it returns the google search with title and url. I am using C# and . NET, when I do the HTTP request to receive page data, it is returning the…
-
0
votes1
answer34
viewsError Nothing to commit (create/copy files and use "git add" to track)
So, I’m starting in git and I’m finding it difficult to commit a file. I did the whole step by step, created a repository and I can get to the add part (git add *), but when it comes to doing commit…
-
0
votes1
answer41
viewsASP NET Core Dynamic value "Route"
Can the route parameter be dynamic? for example I want that when Uf is "sp" I put sao-paulo, and so on with the other states. Because then when I load the aciton it loads the url as I reported it.…
-
0
votes2
answers158
viewsHow do I always return the same View, independent of Controller and Action?
I created a View calling for Manutencao that displays a maintenance page. And whenever the Index is called I display it. public class HomeController : Controller { public ActionResult Index() {…
-
0
votes1
answer24
viewsHow to compare a string to a datarow
that’s the code: Dim clientesCadastrados As DataTable = MnipulaDB.ConsultaSql("SELECT CAMPO1 AS NOME FROM TAB_CLIENTES WHERE CAMPO21 =1") For Each cliente As DataRow In clientesCadastrados.Rows If…
-
0
votes0
answers18
viewsHow to close window press Process Start in c#automation?
Hello I am doing an automation and for that I needed to open the Power Options window in windows. For this I used the method: Process.Start("Rundll32.exe", "shell32.dll,Control_RunDLL…
-
0
votes0
answers9
views -
0
votes0
answers81
viewsProblem importing a . net framework project into a . net core project
hello, I’m creating a . net core application but I need to use a . net framework project. i can import it without any error but at runtime an exception is fired. The Exception says that it was not…
-
0
votes1
answer61
viewsmaskMoney Jquery on Gridview
Guys I need to make a coin mask using Maskmoney where the Textbox comes from a dynamically generated Gridview or I don’t know how many lines there are in it. I’m doing it this way but it only works…
-
0
votes1
answer350
viewsDoes not contain a constructor that takes 0 arguments
My code is public partial class TelaInicio : MetroFramework.Forms.MetroForm { internal ExibirDados exibirdados = null; public TelaInicio(ExibirDados exibirdados) { InitializeComponent();…
-
0
votes2
answers128
viewsWhich type is inherited from an . NET array?
If we declare a List, we are sure that your type is explicitly the System.Collections.Generic.List<T>. But when we declare one array? What is the generic type implemented behind it? Example:…
-
0
votes1
answer116
views -
0
votes1
answer31
views -
0
votes1
answer54
viewsCreate a label when reading data from a file
I am trying to create a button that, using the information deposited in 3 files (labelName, Labelx, Labely), create a number of cells according to the number of entries. That is, if I have 1 entry…