Posts by Caique C. • 2,785 points
34 posts
-
4
votes6
answers3120
viewsA: How can we not allow numbers in a textbox?
Only one alternative, complementing Samir Braga’s response. Example to allow only numbers in a text input without using jQuery: document.getElementById("nome_contato").onkeypress = function(event) {…
-
0
votes1
answer280
viewsQ: Can I have procedures with the same name and number of parameters in the same package (ORACLE)?
I can have a package with two procedures of the same name, quantity and type of parameters just by diversifying the name of the parameters?
-
6
votes1
answer75
viewsA: Is it possible to hide a public method from the abstract class?
Instead of using the access modifier public, utilize protected. A method protected Classea’s visibility will be limited to the classes that inherit it, that is, within Classeb, but who instantiate…
-
4
votes1
answer1060
viewsA: HTTP 500 error using Httpwebrequest
In the Catch of your Try, capture a WebException. It has several information: answer(property Response), code(StatusCode), etc.. See the documentation of WebException:…
-
7
votes2
answers5849
viewsA: How to cut a string?
Use the method Substring. var nome = "Josénildo da Silva Ramos do Carmo"; var novoNome = nome.Substring(0, 20); The first parameter indicates the initial index and the second is the count of…
-
1
votes8
answers2805
viewsA: How to know which is the last element on a list?
... string ultimoItem = ""; //verificando se há itens na lista para evitar possíveis erros if (campos.Count > 0) { ultimoItem = campos[campos.Count - 1]; } …
-
0
votes1
answer79
viewsA: Items not being updated
Try it like this: cmb.SelectedIndex = 1; Or if you want to fill in from a value: int index = cmb.FindString("valor"); cmb.SelectedIndex = index;…
-
2
votes1
answer1496
views -
7
votes5
answers2278
viewsA: Is it safe to use $_GET in PHP? (Parameter in URL)
DEPENDS! Just to complete the cake recipe, we have not only the GET, but the POST as well. The GET and POST methods have different purposes. According to HTTP, GET serves to take resources from a…
-
1
votes2
answers415
viewsA: How to check if Eval has null value?
Use this way and see if it works: <%# if(Eval("IdEntradaItem").ToString() == string.Empty) ? " - " : Eval("IdEntradaItem").ToString() %>
-
1
votes2
answers573
viewsA: Query in a column with different values
I would recommend separating the name into two columns in your database. An alternative, considering two names: string doisNomes = "Fulano Sicrano"; string[] arrayDeDoisNomes = doisNomes.Split(' ');…
-
2
votes1
answer1887
viewsQ: Download txt file with ASP.NET Web Forms including HTML of the page in the file
I am downloading files with ASP.NET Web Forms at a Linkbutton click event as follows: var file = new FileInfo(filePath); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment;…
-
2
votes2
answers80
viewsQ: How to ensure that the instantiation of a class is done only through "using"?
I am creating a DLL with some database features (ADO.Net). It would be very convenient to ensure that instantiation of connections is always used only via using (block), not to forget to call the…
-
39
votes3
answers25089
viewsQ: What is the function of a static method?
Is it just convenience? I mean, it’s unnecessary to instantiate an object to use a function that doesn’t use the data from it. Is there a difference in execution? Memory, processing - resources in…
-
4
votes3
answers2878
views -
3
votes1
answer65
viewsQ: What is System.Void type
Until then I believed that void was just a keyword to indicate a no return method, but then I found System.Void on MSDN. This changes something?
-
4
votes1
answer66
viewsQ: What are and how the following statements work in Web Forms pages: <% %>, <%# %> and <%: %>
I don’t know what they are or what to call them. Are they tags, statements? What are they? In practice, I noticed some characteristics. <% %> This statement accepts executable code, but…
-
1
votes0
answers33
viewsQ: What happens when I declare to be using (using) a namespace in a class?
When I declare the use of a namespace (example: using System;) in a Cs (C#) file, what happens? Am I just putting the classes belonging to the namespace in the scope of the class? Is there nothing…
-
4
votes1
answer818
viewsQ: What is the Dynamic Proxy generated by the Entity Framework?
What is the Dynamic Proxy generated by the Entity Framework? And a class? What is its function?
-
3
votes1
answer226
viewsQ: Why are relationships in the Entity Framework code first pointed with Icollection<T>?
Why are relationships in the Entity Framework code first pointed to with Icollection? What is the best instantiation(?) for the property in common cases? List? Using the virtual keyword is only to…
-
1
votes2
answers84
viewsQ: Is there a LINQ method that returns a default value of my preference?
Is there any LINQ method that returns a default value of my preference, which fulfills the role of this method in a more efficient way? public static int? procurarIdPorCpf(string cpf) { using…
-
4
votes3
answers1352
viewsQ: How to transform a date into a string format without signals in Datetime?
Examples: string data = "08072013"; string hora = "1515"; Is there a specific method for this type of format? I tried to use Convert.ToDateTime(), DateTime.Parse, etc. and all returned me an…
-
4
votes1
answer350
viewsQ: What’s the difference between using Savechanges() only once after adding data via a foreach and using inside the foreach?
I’m entering an average of 50,000 records into the database via the Entity Framework. And I got a question regarding the following code placements: in the first (1) placement, I use a foreach…
-
2
votes1
answer1692
viewsQ: How do I read a Datagrid, line by line?
I have a DataGrid (WPF) filled by an external data source. I need to rotate the entire grid, checking the values of each row, column by column. How is it possible to do this? What is the "heart" of…
-
2
votes1
answer631
viewsA: ODBC does not support reading DBF file?
In this case the problem was really in the connection string. In this OS question - https://stackoverflow.com/questions/11356878/get-data-in-a-dbf-file-using-c-sharp - the correct form is found.…
-
3
votes1
answer631
viewsQ: ODBC does not support reading DBF file?
I’m trying to read a file .dbf following a tutorial I saw on the site of Macoratti (Obs. I think everyone knows). And when executing the method below, is launched a OdbcException with the following…
-
16
votes3
answers6549
viewsQ: What are providers? What is the difference between OLE DB and ODBC?
I need to read files dbf. I found a tutorial to read the same where the author uses these two providers. I only saw differences in the connection string. What are these providers? What is the…
-
17
votes2
answers5822
viewsQ: What is aspect-oriented programming?
What is aspect-oriented programming? I heard about it in a conversation between colleagues these days. Nobody explained me well and more, said it was something bad.
software-engineeringasked Caique C. 2,785 -
3
votes1
answer82
viewsQ: Doubt about performance in using the statement
Which of the two ways to verify if a record of such TYPE has ever been registered is more performative? Are there differences, errors? What are the implications? The block using frees only…
-
25
votes4
answers5615
views -
68
votes1
answer19312
views -
2
votes2
answers1179
viewsQ: How does MVC layer-to-layer communication work?
I started studying MVC, but I’m still in theory and I was wondering how the conversation between the layers works in practice. One could give an example of C# code without using the MVC framework?…
-
13
votes3
answers17303
viewsQ: What is the best way to read an XLS file?
I would like to know the best way to read an XLS file in C#. I can handle it the same way I handle a database table?
-
3
votes1
answer537
viewsQ: Can I fill a Datagrid with a List<T>?
How do I fill one DataGrid from a List typical? It would be possible to generate the columns automatically?