Posts by Richard Dias • 1,797 points
83 posts
-
0
votes1
answer66
viewsQ: Bde package reference error in Delphi
I need to recompile a legacy application that came from a company we acquired. In this project has the reference to what I believe to be the package (Comic), that as far as I know has been…
-
1
votes4
answers492
viewsA: Orable DB and MVC 4 - Connection error (ORA-06413)
The @Marcusvinicius response solved my problem for web projects, but I continued with a problem for desktop applications such as windows forms and console aplication. Watching the @Hendrigwernner…
-
0
votes1
answer414
viewsA: Questions with XML Mapping
The solution for the mapping found was the following: public class DeclaracaoImportacao { [XmlElement(ElementName = "adicao", Type = typeof(Adicao))] public List<Adicao> Adicoes { get; set; }…
-
0
votes1
answer414
viewsQ: Questions with XML Mapping
I have a file XML as below and I have some questions regarding how to map it to make the deserialization. I am using C#. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>…
-
0
votes2
answers120
viewsA: textbox saving in bank even if empty
What happens is that the section below will never be true, because by default the mask is applied. if (txtFone.Text.Trim() == string.Empty) { MessageBox.Show("O campo Telefone é obrigatório!");…
-
0
votes2
answers1443
viewsA: ORA-22922: nonexistent LOB value in SELECT
I couldn’t figure out why the error occurred, but after two days trying, I was able to solve my problem. If anyone knows the reason for the error and has more detailed results will be very welcome.…
-
2
votes2
answers1443
viewsQ: ORA-22922: nonexistent LOB value in SELECT
I am facing a problem with two different consultations on oracle. Both have the sql snippet REPLACE(dbms_lob.substr(wm_concat(disctinct <COLUNA>)), ',', ', ') The error that returns is the…
-
1
votes9
answers2096
viewsA: How to assign a function with parameters to click without executing it?
Firstly, it was not clear enough how the first call of this method is made and where these initial parameters come from. If this information were present, it would be easier to give a more assertive…
-
2
votes1
answer183
viewsA: Array to solve hidden sentence puzzle
To do using C# would be like this: using System; public class Program { public static void Main() { //Array de caracteres utilizadas para montar a frase var letras = new string[] { "m", "D", " ",…
-
2
votes1
answer202
viewsA: How does this class work?
I hope that the comments and references used can help you to better understand. public class AcessoDAL { //Construtor da classe sem parâmetros. //Não há necessidade desse construtor pois os seus…
-
1
votes1
answer567
viewsA: Form does not do the action
As @Diegofelipe said, when you want to take the value of a field, you don’t need to use the Display:none, just change the field type to hidden that it will not be displayed to the user. It would…
-
6
votes3
answers82
viewsQ: Help with Regex
Before asking I looked for several references, but still do not understand much and I managed to get only to a certain point. My goal is to validate that a string specific has 10 characters, the…
-
3
votes2
answers525
viewsA: Path null parameter
Add a new route, so you don’t need to modify the URI. routes.MapRoute( name:"Information", url: "{controller}/{action}/{information}", defaults: new { controller = "Home", action = "Index",…
-
0
votes1
answer43
viewsA: Gridiview in Asp.net mounting
You don’t need to iterate on the DataReader to do the DataBind. Just define the DataSource and call the method DataBind as below: String sql = "SELECT…
-
0
votes2
answers234
viewsQ: Webforms Upload multiple files
I have an app WebForms that needs to receive multiple files that will be associated with a specific type of my system. Ex: Type: [Driver’s license] | Filing cabinet: img001.png Type: [Proof of…
-
1
votes3
answers847
viewsA: Conversion of a variable with replace to decimal
You must use the replace if you want to format the value for presentation to the user. Otherwise just convert direct. A different case is whether this string comes the user. By default the tab . is…
-
2
votes1
answer83
viewsA: Exception in Split()
You can try a different approach. Before performing the split you can perform the "Cleaning" of string, removing the unwanted characters. Following your example would look like this: var padrao =…
-
1
votes2
answers448
viewsA: how to send input value to control using querystring Asp.net?
Change of FormMethod.Post for FormMethod.Get that the field value will be sent as querystring.
-
2
votes1
answer129
viewsA: Dropdownlistfor in a for
The object SelectListItem owns a property Selected. if she has the value true, this item will be selected. If no item has a value true for this property the value selected is the parameter…
-
2
votes4
answers855
viewsA: Deserialize JSON
EDITION I had not listened to the fact that the deserialization was implicit. to receive more than one object of the type Itemprevenda you must modify the signature of your public async…
-
1
votes2
answers212
viewsA: Identify file execution within a ZIP
The solution I found for solving my problem was to create an executable that contained the zip file with all the files and put it as Recurso incorporado or Embedded resource and perform content…
-
1
votes2
answers125
viewsA: Implementing relationship in C#
Add a reference to Mae in the child. If it is a dependency, set as parameter in the child constructor. Following example: public class Mae { public string Nome {get; set;} public List<Filho>…
-
2
votes4
answers492
viewsQ: Orable DB and MVC 4 - Connection error (ORA-06413)
I have a dll which is responsible for carrying out the consultations in the bank. Therein dll, in the connection class, I have a method that opens the connection to the bank and returns the…
-
6
votes1
answer242
viewsQ: Google Chrome sandbox
On some pages of a system I work on (I’m not the only developer) a message appears on Google Chrome as the image below: This only happens in Google Chrome, Firefox works normally. The test server…
-
0
votes2
answers651
viewsA: Get the correct Index without duplicating the Select Option
It is repeating because you are leaving fixed in the first position the selected day. What you should do is check on each item if the value passed is equal to the index of the day. Following…
-
1
votes4
answers872
viewsA: I need different ways to rearrange characters within a string, how do I do that?
Making a change to @Kevin’s reply I think it would be more right in using non-numeric strings as well: public bool EhPalindromo(string texto) { var textoAoContrario = String.Join("",…
-
0
votes3
answers1363
viewsA: Detect when input value is changed via js
If you can modify the function that changes the value of the field, I believe the problem is easily solved by adding the line $("#teste").trigger('change'); just below the line modifying the field…
javascriptanswered Richard Dias 1,797 -
5
votes4
answers2257
viewsA: Check if user is logged in
In the controllers you want only authenticated access put the attribute [Authorize]. This attribute checks if the user is authenticated and if not redirected to the login path entered in web.config.…
-
1
votes1
answer420
viewsA: Error while trying to pass a controller list to view ASP NET MVC
I advise you to do the following: Create a class to encapsulate chart information Add a data model to this view You can do it this way: //Classe para o encapsulamento public class ItemGrafico {…
-
-1
votes1
answer587
viewsA: How to group elements dynamically indepente the size?
try to use the following markup HTML that should work: #conteudo { float: left; width: 80%; height: 400px: } #barra-lateral { float: right; width: 20%; height: 400px;: } .item { background-color:…
cssanswered Richard Dias 1,797 -
0
votes3
answers6938
viewsA: Problem Breaking a String
Where are you displaying this generated message? If it is in a context HTML, you can use mensagem.Replace(Environment.NewLine, "<br />") before showing that it should work. Another option…
-
0
votes1
answer1608
viewsA: How to convert a Decimal value to Datetime?
I think what would make more sense is the conversion to a Time gap (TimeSpan). If so you can use the section below: TimeSpan.FromHours(Convert.ToDouble(decimalValue)); Otherwise you can try the…
-
2
votes1
answer825
viewsA: Redirecting in Codeigniter
For the creation of the modal, do the following: Pass a parameter to the view indicating whether to display a modal In the view check the value of this variable, and if the value is positive (true)…
codeigniteranswered Richard Dias 1,797 -
1
votes2
answers902
viewsA: Loop foreach error: syntax error, Unexpected 'foreach' (T_FOREACH), expecting ')
You cannot use a repeat loop within a variable statement. The right is for you to create the variable and change its value, in this case adding items in the array. Try to do as below: public…
phpanswered Richard Dias 1,797 -
1
votes2
answers1576
viewsA: Take the value of a form that has a list
If you will use a form to enter data, you must put the type of button as submit. If that’s the case, try doing something like this: @using(Html.BeginForm("Salvar", "Algum", FormMethod.Post)) {…
-
0
votes4
answers844
viewsA: How to create properties dynamically in C#?
Using an anonymous object should work, just use new { nome = "" } instead of using new Object { nome = "" }. Utilise dynamic as @Fernando suggested in his reply should also work.…
-
1
votes1
answer1029
viewsA: Doubt Insert Image with Jquery?
Try to change your javascript for something like: <script> function BuscarCaminho() { //Pega o elemento 'select' var select = document.getElementById("selecao"); //Altera o valor do atributo…
-
1
votes3
answers792
viewsA: Add DIV’s with different ID’s using Jquery
You can use the date of creation of div to ensure a unique id for div. To generate the id based on the date do the following: var id = new Date().getTime(); With this you will ensure uniqueness in…
-
1
votes4
answers1604
viewsA: Access javascript variable in template loop
Try using the syntax razor and then assign the value of a array generated for the variable javascript. Something like that: @{ var vetor = new object[Model.Count()]; } @for (int i = 0; i <…
-
5
votes2
answers780
viewsQ: Multi-tenant system with the possibility of "customization"
I am raising knowledge for the creation of a multi-tenant system. I’ve been taking a look at some references from MSDN, SOEN and SOPT, as well as several websites. Although I have read the…
-
3
votes4
answers374
viewsA: Orderby in lists<T>
If you are using the form below all you need to do is add one using System.Linq at the beginning of the file. public class Pessoas { public String Nome { get; set; } public DateTime Nascimento {…
-
1
votes1
answer1932
viewsA: How to work with multi-level dropdown menu in bootstrap?
The bootstrap no longer supports multi-level dropdown natively, but you can use an example like This one to do what you want.…
twitter-bootstrapanswered Richard Dias 1,797 -
0
votes2
answers801
viewsA: Confirm form closure
The variable evt must have a property cancel or something like that. Just set yourself as true in case the user did not want to close that the closing will be canceled and you can hide the form.…
-
9
votes3
answers2931
viewsA: Azure Collection, in Real or Dollar?
When you hire a service for $100.00 for example and the dollar rate is at R$3.15 as today, you will pay R$315.00. If in the next invoice the dollar quotation drops to R $ 2,50 and your hiring is…
windows-azureanswered Richard Dias 1,797 -
1
votes1
answer970
viewsA: Use Ancora and update the page with Javascript
And if you wear something like that: window.location.href = "http://www.meusite.com.br/...?aba=01"; then just change the value of the parameter aba to know which tab should be selected. Depending on…
-
1
votes1
answer1098
viewsA: Search in Datagridview populated by typing on it
Add a field of the type TextBox just above your DataGridView and add a handler to the event TextChanged and within this handler do as code below, taking into account your needs: var termo = (sender…
c#answered Richard Dias 1,797 -
1
votes1
answer1626
viewsQ: Messagebox with autoclose
I’m having some problems with an application I created, using C# and Windows Forms, and the situation is as follows:: The app is a chat. It does not keep record of conversations; When the…
-
1
votes3
answers1378
viewsA: Datetime field display in View with hours, minutes, day/month/year?
Without you using it jQuery you can use the plugin Datetimepicker. Just read the documentation and apply to the fields you want this format. An example would be to do something like this in HTML:…
-
1
votes3
answers4129
viewsA: Directory problems
Try to use the following: var fi = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); //No exemplo citado presumo que seja um executável var pastaExe =…
-
4
votes2
answers1206
viewsA: Click event not working
to work you must replace the section below: $(".noticia").click(function(){ for: $(document).on("click", ".noticia", function(){ As its elements are not present in the DOM when the page is loaded…