Most voted "c#" questions
This tag should be used when the question refers to some resource, information or problem related to the C#language. C# ("C Sharp") is a multi-paradigm programming language that has strongly typed variables, is imperative, declarative, functional, generic, object-oriented and component-oriented, which are designed to be executed in . NET Framework.
Learn more…13,899 questions
Sort by count of
-
0
votes1
answer307
viewsHow to concatenate data from a Datagridview and Save to a single database field
I want to concatenate and save the fields of a datagridview, but I don’t know how to do it. What I Have: method: public void Gravar() { string strQuery; strQuery = "INSERT INTO Prato"; strQuery +=…
-
0
votes1
answer103
viewsXamarin Build FAILED Error: Unsupported major.minor version 52.0
I’m using Xamarin Visual Studio Comunti 2015 After compiling a project, I get the following err: Exception in thread "main" 1>java.lang.UnsupportedClassVersionError: com/android/dx/command/Main :…
-
0
votes1
answer175
viewsLoss of focus on Entry in Xamarin
I’m building a mobile application with Xamarin Forms and C# where I need to check the CPF and validate the email. I am wanting to do the validations as soon as the field loses focus. I am using in…
-
0
votes0
answers130
viewsRedirect application on IIS when pool is stopped
I have an ASP.NET C# application that is updated by another application on the server. When I start the process of updating the first application in the second I stop the pool in which the first one…
-
0
votes1
answer41
viewsHow to use regular expression without using the Regex class?
I need to validate the input of values and strings, but I have doubts about how to use without using the Regex class, how can I get the solution? var CampoExpressao = new Regex(@"[0-9]"); Above has…
-
0
votes1
answer67
viewsHow to display two Textbox from a result in the Dropdownlist
I display a Dropdownlist with two SC and PR values, if it selects SC then I want it to display two Textbox, one with the RG, and one with the Date of Birth, and if the person selects PR, I want to…
-
0
votes0
answers412
viewsC# - Tool for signing a PDF document
I need a tool that allows a person to sign a PDF document at a particular location of the document, does anyone have any tips? But you have to allow it to do this internally in my application, tools…
-
0
votes0
answers44
viewsJavascript code processing for c# (treeSample)
I’m trying to pass a code running in javascript, for c# I’m having difficulty with the syntax, the code transforming the list of data into a tree structure. someone could help? // Array de dados. A…
-
0
votes0
answers100
viewsSlow loading of Ionic 3 images
Good afternoon, I developed an app selling products and, is working perfectly. My only problem is how to upload images. I downloaded some store apps, and the images appear almost instantly and in my…
-
0
votes1
answer239
viewsC# - Decode JSON array
I need to get the id of that code JSON using C#: [{"nome":"Gabriel Ferreira","cidade":"São Paulo","uf":"SP","id":"4274892"}] Can someone advise me how I can do this in the best way, because I’ve…
-
0
votes1
answer472
viewsHow to add/remove items within the Cart
I would like to make a simple Cart, where I used as a base some explanations here inside the same Stack. It follows below my Cart Controller: public class CarrinhoController : Controller { private…
-
0
votes1
answer394
viewsProgress Bar - How to take decimal values?
By learning, I am creating a very stupid "game" in C# and I make a bar the bar of life, but I need to decrease a decimal value and apparently the Progress only takes int values. How can I get her to…
-
0
votes1
answer100
viewsUsing cache during user session
I am using Outputcache in an Asp.net mvc5 application to cache a list in my application as follows : [(Duration = 60, VaryByParam = "none")] public ActionResult Index() {} I just need to take…
-
0
votes2
answers1356
viewsDatareader opens and gives error by not closing
I have a DataReader on my website to read the data that the bank brings. There when two people enter different computers, and even different browsers, opens a connection, but at the time I will read…
-
0
votes1
answer64
viewsAnimation to decrease the size of a cube in Unity
Hello! I’m in Unity using C# and I have a cube that, when I press q, it drops to 0.5 scale from scale 1 and when I drop q, he goes back to scale 1. I wanted there to be some quick animation of the…
-
0
votes0
answers19
viewsBest way to accomplish complex builds
I have an application that dynamically loads dlls and other components at runtime, and I’m looking for a solution to build "complex" builds in the style of Apache Ant (available in Java). What…
-
0
votes1
answer1236
viewsError {"The object reference was not defined as an instance of an object." } System.Nullreferenceexception MVC ASP.NET
Well, it now gave me an error on the main page so I tried to pass the resgisto values to the index. the error is in line 35 of the index of the main page with the code: @foreach (var item in Model)…
-
0
votes1
answer23
viewsValidation of all Text Boxes
Code: if (this.Controls.OfType<TextBox>().Any(f => string.IsNullOrEmpty(f.Text))) { MessageBox.Show("É necessario preencher todos os campos.", "Atenção", MessageBoxButtons.OK,…
c#asked 6 years, 6 months ago Ricardo Melchior 11 -
0
votes1
answer206
viewsHeader and Footer with ASP. Net C#
I’m doubtful to separate my code,I did some tests of having separated the header and footer but in visual studio I did that can only have only one <% Page, as I can separate the header and footer…
-
0
votes1
answer41
viewsLimiting functions according to access level
I have the form MenuPrincipal and the FormLogon, where the latter, after carrying out the login validation queries, calls the Menu and closes. I need to limit some buttons and controls according to…
-
0
votes1
answer160
viewsHow to change value within a gridview c#line
Staff I am working on a PDV form and I am with the following doubt. In my example it would be like modifying the quantity of the same product in a single line without having to repeat the product…
-
0
votes1
answer207
viewsInsert data into a real-time text box with Timer
I’m using timer as follows: System.Timers.Timer aTimer = new System.Timers.Timer(); aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); aTimer.Interval = 1000; aTimer.Enabled = true; In the…
-
0
votes1
answer33
viewsXamarin installation error - JDK does not install
Hello! I have this problem after the completion of the installation of Xamarin. I have tried to download the sdk from the Oracle website, but the installer simply doesn’t start, nothing happens. I…
-
0
votes1
answer597
viewsrun Task.Whenall wait and then run back
I’m trying to make a console program, run a task, wait and run again and continue in this cycle endlessly. In theory it would place the function within a While(true) infinite loop, but as the…
-
0
votes1
answer179
viewsIs Asp.net MVC better working with Areas or Projects within a Solution?
I’m creating a portal and separating the modules by Areas. But the demands are increasing a lot, already has at least 5 more modules to be written in the portal. What is the best way forward in…
-
0
votes0
answers133
viewsHtml "active" of the Carousel
Good. I have a project with several views that contain a Carousel. For example, this is my main page and when I press, for example, the first "See more" button this appears So far so good! But if I…
-
0
votes1
answer59
viewsI want to use 2 threads inside the foreach C#
I don’t have much experience in C#. But I’m trying to understand the code of a program I have here. Here use the following code: foreach(var item in _main.entrada) { .... } I want to include…
-
0
votes0
answers84
viewsError in TASKKILL Command
I would like to close a program when there is error in my system, for this I am using: TASKKILL /F /IM executavel.exe /T I used to develop a machine with W7 and it worked, but the client uses W10…
-
0
votes1
answer463
viewsPost to an external url
They put me on a project that was done in ASP. NET MVC 2 and need to be done the integration with Itaú Shopline, I downloaded the dll from Itaú, I did all the encryption procedures, I can generate…
-
0
votes0
answers157
viewsPause program while executing a c#code
I am in doubt in the use of threads, I want that, in a given time, the program stops responding and only comes back when I determine... Example: System.Threading.Thread.Pausa(); // Executa código…
-
0
votes2
answers613
viewsComparing multiple Textbox fields to check for duplicity
I’m developing a basic C# program where the user will enter values through a barcode reader. It will be saved in an Excel spreadsheet for a future report. My problem is that there are situations…
c#asked 8 years, 1 month ago Luiz Felipe 57 -
0
votes0
answers47
viewsList data in a Dropdown related to the result of another Dropdown
I’m rephrasing that question, because it must not have been very clear. What I want is this: Choose a restaurant at Dropdown, and the next dropdown, list the times that were registered by that…
-
0
votes0
answers25
viewsVERSION OF THE LANGUAGE C#
Hello, When I create a project, in visual studio, it provides me the option to choose the version of . Net(...4.5, 4.6, 4.7...) that I want to use, but does not inform the version of the language…
-
0
votes0
answers59
viewsHow to pass information from a Ritchtextbox to word document
How do I pass the information that is in a Richtextbox to a word document in C#. Code: String strtxt = rtbVertigo.Text; TextWriter sw = new StreamWriter(@"D:\Users\edv\Desktop\WORD\Vertigo.doc");…
-
0
votes1
answer75
viewssend request at the first button click
I have to fill some combobox at the click of a button. When I click on this button it first loads a modal and the second time I click it creates the modal loading the data I need, making the request…
-
0
votes0
answers51
views -
0
votes1
answer47
viewsAPI problem after deploying
My api is not working after deploy to the server, it is returning: 404 - File or directory not found. The Resource you are Looking for Might have been Removed, had its name changed, or is…
-
0
votes2
answers142
viewsIs there any way for a form to inherit from _Layout.cshtml in c#?
I’m developing a website on asp.net c#, I have a contact page that contains a form for the user to fill and send if you want to send an email. I wanted the page of this form to inherit the…
-
0
votes1
answer1107
viewsCannot convert "string" to "int"
<% foreach (System.Collections.DictionaryEntry entry in HttpContext.Current.Cache){ HttpContext.Current.Cache.Remove((string)entry.Key); } foreach (int key in diamondMethodList) {…
-
0
votes2
answers214
viewsKnowing when my list is coming with values in sequence
I have a List<int>: [2,3,5,4,6] Although not in order, it is a sequence of numbers (2,3,4,5,6) How do I validate this? Note: There will always be 5 positions and the numbers will be from 1 to…
-
0
votes0
answers262
viewsMysql with Entity Framework Code First
I have a project where I need to use Mysql as a database and EF6 with the CODE FIRST approach. I installed Mysql.Data.Entity 6.9.9 and Entityframework 6.1.3 My app.config looks like this:…
-
0
votes1
answer2358
viewsC# - How to print all the values of an array with the Console.Writeline(??);command?
//Copy an array and print the 2. int[] original = new int[] { 2, 5, 3, 8, 9, 12, 15, 7 }; int[] copia = new int[original.Length]; for (int index = 0; index < original.Length; index++) {…
-
0
votes0
answers139
viewsBuild error when adding "using Mysql.Data.Mysqlclient;"
when I add using Mysql.Data.Mysqlclient; appears the following error message: "cannot start debugging because the debugging target 'c: users Documents visualstudio2018 Projects Application bin Debug…
-
0
votes1
answer107
viewsHow to find a number inside an HTML list
I’m trying to find the number that the person wrote in the box, in Document.getElementByID on the site, but I can’t do in c#, or tried at least: private void btnvalidar_Click(object sender,…
-
0
votes1
answer637
viewsfilter table Asp.net mvc
I need to filter a table, which is in a partial view, depending on the parameter typed in a field, which is passed to the controller via ajax. How to reload the table with the filter applied? Part…
-
0
votes1
answer538
viewsoverwrite certain line of the txt file
I’m making a code where I need to delete a particular line in a text file (.txt) and put something else on that line, I’d like to know how I can do that. Example: delete 2 line admin and write user…
-
0
votes2
answers98
viewsEF6: Error while Saving
I have the following scenario that I’m in trouble: Category: public class Categoria { public int Id { get; set; } public string Descricao { get; set; } public virtual ICollection<Produto>…
-
0
votes1
answer25
viewsPossible values for Comboboxpopupanimationkey?
I recently had a bug with combobox in the WPF. Was a bug related to a "blurring" in the source when it had only one item in the combobox while it opened. I solved the problem by removing the…
-
0
votes1
answer191
viewsASP . NET - Local file directory using Chrome
I have the following code snippet: <div class='upload-border'> <input class='file-upload' id="fileUpload" runat="server" type="file" name='upload'/> </div> I need to get the local…
-
0
votes1
answer143
viewsHow to download direct from TXT file
I uploaded a file to a WEB server, but when I use this code: WebClient update = new WebClient(); string Teste = update.DownloadString("http://testexxx.000webhostapp.com/teste.txt"); Returns this…