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
-
1
votes0
answers218
viewsAccess Database File, SYBASE
I need to remove the data from a database file (.db) that I was told is SYBASE, the client needs to migrate data and I need to access, does anyone have any idea where to start? because never heard…
-
1
votes1
answer114
viewsMTA Thread Attribute affects in Thread
Suppose I have the class static class Program{ [MTAThread] static void Main(string[] args){ Application.Run(new Form()); } } and simply want to apply a Thread.Sleep(1000); This keeps the Form stable…
-
1
votes1
answer595
viewsRecover property of Object Anonymous C# Razor
I am working with MVC4 and Restsharp for data access via API Rest, My return is an object of the type Object but I cannot recover a specific property of this object. How can I access the property?…
-
1
votes1
answer133
viewsC# How to get the duration of an MP3 that is in an HTTP address
I need to get the MP3 duration information that is on an HTTP server using the C language#. I tried Taglib# and Naudio, without success.
-
1
votes3
answers1002
viewsNamespace Serialization with link
I’m working with Serialization, I’m adding Namespace to two tags, nfeProc and Nfe. I can normally add the following: [XmlRoot("nfeProc", Namespace = "http://www.portalfiscal.inf.br/nfe")] In XML:…
-
1
votes2
answers114
viewsReceive variable value in 'Where in'
In my procedure I have the following variables: @Codigo VARCHAR(MAX),@cont as int, @DataPago as VARCHAR(10) Via C# application I am passing the values as follows: y1.Parameters.Add("@Codigo",…
-
1
votes0
answers765
viewsMICROSOFT.OFFICE.INTEROP.WORD - Object Reference not set to an instance of an Object
I am in need of help with this problem using Microsoft.Office.Interop.Word. Detail: running the application in visual studio it works normally, without any error, however, if I play in IIS, it…
-
1
votes1
answer2298
viewsPass method parameters through the URL
How do I capture the parameters requested by the URL in a webservice? For example: I have the following webservice: http://localhost/teste/WebService1.asmx/Produto How to pass method parameters…
-
1
votes1
answer135
viewsHow to pass data from an activity to a dialogFragment?
In my activity I have it: mBtnSignUp.Click += (object sender, EventArgs e) => { //Pull up dialog FragmentTransaction transaction = FragmentManager.BeginTransaction(); dialog_SignUp signUpDialog =…
-
1
votes1
answer111
viewsHow to plot a Stackedcolumn100 chart?
I’m returning a bank query for a DataTable and using it to Json. I use the following method to Serialize my Datatable for Json. public static string ConvertDataTabletoString(DataTable dt) {…
-
1
votes2
answers278
viewsDynamic property in Static class
I have a static class and in it I have a method too static. The method returns a value that is cached, however Key, it has the dynamic value: key = User.Identity.GetUserName(); public static class…
-
1
votes1
answer58
viewsHow can I use a Hyperlink inside a Listbox?
I want to make a HyperLink for each result that will appear within the ListBox. private void listBox_SelectionMode(object sender, EventArgs e) { LogisticaServiceContractClient Logistica = new…
-
1
votes1
answer110
viewsC# Movement of Files
I’m doing an application, and at some point it does the following: Checks if a file that will be created already exists in a directory (output), if it already exists, it sends to the Errors folder,…
c#asked 10 years, 1 month ago Yuri Ancelmo 353 -
1
votes1
answer318
viewsReport Viewer with object dataset
Hello, I’m wanting to assemble a report in Reportviewer but I wanted to use an object as a data source, I saw some articles on the internet but I can’t make Reportviewer find my object to select, it…
-
1
votes2
answers1503
viewsFind out what type a CNPJ verifier is
I have a class where I can find out if the CNPJ entered by the user is valid or not. What I’d like to do, and what I’m not getting, is show the user which are the last two valid digits he should…
-
1
votes0
answers443
views -
1
votes1
answer472
viewsFormat mask for Timestamp attribute
I need to display the value of the TIME attribute only HH:mm (hour and minutes). By including the following masks an error occurs: The input character string was not in an incorrect format. I tried…
-
1
votes1
answer1834
viewsData Search with Datagridview
I’m working with Winforms and I’m trying to implement a DataGridView(dgv) on a research form I have in my project. What happens is: I have two dgvs that form the sort of master-detail. I did it by…
-
1
votes0
answers76
viewsCall EF entity by name and perform dynamic search
In applying Windowsform that I am developing, I intend to create only one form standard for listing the records that will be called through the system registration menu. That one form listing, and…
-
1
votes0
answers69
viewsUnstable filter at start
I’m having a problem with my filters IIR. I’m trying to filter a signal ECG (Electrogcardiogram) through a filter that passes low IIR, and then through one that passes high IIR. The problem is that…
-
1
votes1
answer241
viewsConvert Datatable to List Entity
I’m trying to use the code below to convert but it gives error everywhere that has the T and where. What could be? // function that set the given object from the given data row public static void…
-
1
votes1
answer387
viewsC#. Image.Getthumbnailimage increasing file size
I have a picture of 320x320. When I use the Image.GetThumbnailImage it generates an image of 180x180. Only the size of the 320x300 file is 10k, the size of the Thumbnail file is 52k... I wish he was…
-
1
votes1
answer63
viewsDisplay a formatted Timespan time
I have two variables: TimeSpan horaI = new TimeSpan(10, 00, 00); TimeSpan horaF = new TimeSpan(22, 00, 00); I need to present them on the screen as follows 10:00 and 22:00. But I’m not getting it.…
-
1
votes2
answers166
viewsHow to use Measurestring method?
I have the following code: var font = new Font("Arial", 50); var texto = "Meu texto"; var res = Graphics.MeasureString(texto, font); // Está linha não funciona. When compiling the following error is…
-
1
votes2
answers86
viewsGet the path of a commit files with Libgit2sharp
How to get the file path of my last commit? I have this example method: private static void RepoListFiles() { if (!arguments.ContainsKey("repository")) { Error("O repositório ainda não foi…
-
1
votes1
answer183
viewsSort nodes from Tree view
In my Tree view I have several child nodes. All nodes are created with numbers as these identify a different file and are composed by date. How could I sort these nodes numerically? I mean, like:…
-
1
votes3
answers1235
viewsProblems with Data and Globalize
When performing the Submit in a form with a date dd/MM/yyyy, the value is converted to the American format in the controller, leaving MM/dd/yyyy. Through the answer of this question, configure…
-
1
votes1
answer2096
viewsDelete a specified line from a Datatable
How can I delete a specific line from a DataTable and then reload a ViewState with the rest of the lines that stayed? I have the following case below, but am not getting deleta directly from…
-
1
votes1
answer788
viewsError change with Object reference message not set for an object instance
Guys I’m having the following problem. I created a class for DTO like this: public class PessoaFuncionario { public Pessoa Pessoa { get; set; } public string Nome { get; set; } public string CPF {…
-
1
votes0
answers69
viewsCapture video card name via NVAPI dll
How to import the DLL "nvapi.dll" to the program in C#? Not sure how to capture the video card name: NvAPI_GPU_GetFullName - CEEE8E9F
-
1
votes0
answers89
viewsError passing parameter to function
I’ve lost full access to my websites and I’m trying to pass the posts from it to a new one. I have a code that reads the sitemap and takes the urls and another who picks up the url, separates the…
-
1
votes2
answers899
viewsHow to use Firebird database on network with C#?
I developed a C# Windows Forms application with Firebird database and I need to place the application with the database on a machine that will be like a server. With this, I need to access this…
c# database visual-studio-2013 firebird networksasked 9 years, 6 months ago André Morais Martins 367 -
1
votes1
answer39
viewsError in Savedialog c#
Good, I have this snippet of code in C# and everything is working, but I have an error that I haven’t been able to solve, as you can see in the image and in the code. The label1 is fetching text…
-
1
votes0
answers99
viewsPrevent c# Repeated Posts in Wordpress?
I have the following code, using the Joeblogs Wrapper private static void Postagem(string website) { try { string link = "http://MEU.SITE"; string username = "user_wp"; string password = "senha_wp";…
-
1
votes0
answers84
viewsRepeated post in wordpress c#
I have the following code, using the Joeblogs Wrapper private static void Postagem(string website) { try { string link = "http://MEU.SITE"; string username = "user_wp"; string password = "senha_wp";…
c#asked 10 years, 1 month ago Raul Correia -
1
votes0
answers154
viewsThe number of generic arguments provided is not equal to the aridity of the generic type definition. Parameter name: instantiation
I am having a problem developing an application in Asp.net MVC with IOC, Automapper and all other screens work perfectly, just not that of Drivers. couldn’t identify the mistake, could you help me?…
-
1
votes2
answers3781
viewsWait time to execute new action [Selenium] [C#]
I’m starting with test automation with Selenium Webdriver in the language C#. I have a question, I have to do the test wait for the page to load to perform a new action. How do I do this? I believe…
-
1
votes1
answer301
viewsWhat to use to create web site and android app
I want to create a website to host manga or link the sleeves of Fansub. Let’s say a Manga Host and create an app on android to visualize the sleeves without having to enter the site. How can I do…
-
1
votes1
answer384
viewsHow to delete information in BD using Datagridview?
Can anyone tell me which command should I put to delete from the database using the information of the selected phone? I put it like this: SQLcmd.CommandText = ("DELETE FROM usuario WHERE nome = '"…
-
1
votes0
answers299
viewsBinding in Textbox with Datagrid (WPF)
I have a Textbox where you get the customer id and I also have a Datagrid where he has some personal information. Well so far so good, what I’m not getting is to connect the two in the following…
-
1
votes2
answers271
viewsChange Order by Clicking the Tab Key
I’m using bootstrap in a c#project, and when I click the tab key to change the fields the direction is from right to left, and I wanted it to be the other way around, where do I change? Ex: when it…
-
1
votes2
answers157
viewsAdd @onchange to Editorfor using Razor
Hi, I’m trying to add @onchange to my EditorFor, Yeah, I’m gonna have to add that field dynamically CURRENT LINE @Html.EditorFor(model => model.CEP, new { @class = "classe" }, new { @onchange =…
-
1
votes1
answer72
viewsHow to build a list in Controller and mount a Dropdownlist
I have the following difficulty. My class addresses have the TipoEndereco, wanted to mount a dropdownlist Shall I set up a list on the controller? I got her in the view? Thank you.…
-
1
votes0
answers56
viewsUser settings
I’m kind of a Noob in c# and would like help on an application I’m running. In this application I need user settings to stay Default, but I don’t know a way to do it. I am developing in Webforms.…
-
1
votes1
answer1442
viewsHow to use dynamically created button event to redirect to another ASP.NET page?
I’m trying to call the event the buttons that were created dynamically with a foreach public void adicionarComanda() { List<Comanda> lc = ControllerComanda.getComanda(); foreach (Comanda…
-
1
votes1
answer148
viewsActionresult Dynamic Route
I have two Controllers: College and Course public class InstituicaoController : Controller { // GET: Instituicao public ActionResult Index() { return View(); } public ActionResult Instituicao(string…
-
1
votes1
answer197
viewsAdded multiple items in a Datagrid by List<>
I have two textbox. One for email and the other for notes. When the user clicks on the add button, it should be adding to my datagrid, but without success! How can I do this? As the user clicks on…
-
1
votes0
answers64
viewsHow to improve the loading of related entities using Linqkit?
Hi, I’m using Linqkit To stack "Expression Predicates", I need to do a "foreach" to load the related entities and this is being very expensive for application because to load 1000 records is taking…
-
1
votes2
answers596
viewsHow to display the content of a queue?
I say this because I have created the Fila: Queue<string> Fila = new Queue<string>(); But I can’t show it, string Pedido = (("Cliente:") + Cliente + (Environment.NewLine + "Produto:") +…
-
1
votes2
answers230
viewsHow to implement and use the Binarysearch method?
How to implement and use the method BinarySearch of a List<T>? I’m having difficulty implementing and also how to use it in a practical way. Follow the example for illustration: int…