Posts by Richard Dias • 1,797 points
83 posts
-
1
votes1
answer35
viewsA: Calculation of how many times I need to send a string
I’m not sure I understand the question, but maybe it’s something like this: int numPlacas = CountPlacas(); const int numMaxRegistrosPorMensagem = 22; int numMensagensNecessarias = (int)numPlacas /…
c#answered Richard Dias 1,797 -
1
votes1
answer922
viewsA: Warning: mysqli_query() expects at least 2 Parameters, 1 Given in C: wamp www Trabalho odesi proceslogin.php on line 22
You must change the following line: $result=mysqli_query("SELECT username, password FROM users WHERE username='$login' and password='$password'"); for: $result=mysqli_query($conn, "SELECT…
-
1
votes1
answer84
viewsA: PHP + HTML Unexpected result with $_GET
Try changing for that: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the…
-
0
votes1
answer130
viewsA: Save css code by admin
I think you could do more or less the following: <?php $conteudoProcessado = '* { padding: 0; }'; ?> <form action="salvarArquivo.php" method="post"> <input type="hidden"…
-
3
votes1
answer238
viewsA: Dependency Error
I didn’t see the need to use the Backgroundworker in this example, since you call the method ObterInformacoes() in the method _DoWork from BW and then call him again at _RunWorkerCompleted. this…
-
2
votes1
answer61
viewsA: Duplicate data
Uses the distinct. If you specify your conditions better and the bank used would be easier, but it would be something like this: SELECT DISTINCT(cliente) FROM orcamento…
-
1
votes1
answer117
viewsA: How to use query column data as a row in datagridview?
Not if I understood your question correctly, but I believe it would be more or less that within a loop of repetition to fill the table: var indexCabecalho = dataGridView1.Rows.Add(); var…
-
3
votes1
answer125
viewsA: WPF - How to create a mechanism to make the application available for testing for x days?
I think you’d need the following: Save the installation date (Either on a localDB or in the registry) Identify the current date If you are going to do by date, you should worry a lot about the…
-
0
votes3
answers983
viewsA: Get URL Code ID and insert into JS
Man, the way you’re doing all this seems really complicated to me because you don’t try to simplify? To know which gallery was selected you could do something like this: <ol> <li…
-
1
votes4
answers1210
viewsA: How to check if an input has a string?
Do the following: $(document).on("click", "button.nextButton", function(e){ e.preventDefault(); var endereco = parseInt($("#denuncias_end").val()); var regex = new RegExp(/^-?\d*\.?\d*$/);…
-
0
votes2
answers80
viewsA: Error trying to define or read the value of variables already defined - System.Nullreferenceexception
You set the variable wordBuffer null. wordBuffer = null; and then tries to use it to store a word. wordBuffer[syntaxCount] = word; You must replace the line wordBuffer = null; for something like…
-
3
votes2
answers1526
viewsA: Hidden fields appear/are modified with a select Multiple
And if you used the jQuery to check the selected/unselected modes and show/hide the fields in the event change select? It would look something like this: $(document).on('change', '#multiple'…
-
0
votes3
answers4590
viewsA: How to create dropdownlist Razor in . net mvc via ajax?
As Jhonathan suggested it should work, but you can do it too: Partialview: Dropdown.cshtml @model IEnumerable<SelecListItem> <label>Drop Down</label>…
-
2
votes5
answers631
viewsA: If Else with functions
Yes, you can use, but you must declare them before and use them as follows within the if: function T() { if (a > 1) { Save(); }else { NoSave(); } }…
-
0
votes4
answers2129
viewsA: SQL query with ID from a combobox - C#
And if you did something like this: public SqlDataReader lista_dados_servico(object idFuncionario) { conexao = new SqlConnection(conexao_sqlserver); var query = @"SELECT func_nome, serv_desc,…
-
0
votes3
answers137
viewsA: Doubt in research
I believe that there are two situations that are causing this behavior: CM.Parameters.Add("nameUsu", System.Data.Sqldbtype.Varchar). Value = usuDto.Name; the correct would be:…
-
3
votes2
answers1631
viewsA: Make a combobox take C#
This is very simple, just follow the example below: //Os objetos para serem utilizados var objetos = new List<object>(); objetos.Add(new {valor = 0, nome = "Baixo"}); objetos.Add(new {valor =…
-
2
votes2
answers378
viewsA: Error in reference in C#
You are probably referencing a DLL that uses the Framework . Net 4.5 while in your project uses a version of . Net smaller than 4.0. This is a Higher version than the Currently Targeted framework ".…
c#answered Richard Dias 1,797 -
0
votes0
answers66
viewsQ: Application with Drag and Drop and other effects
I am preparing to do my TCC and the result of it will be an application. In this application I will model objects. To model this object the application will provide some shapes. These shapes should…
-
2
votes2
answers212
viewsQ: Identify file execution within a ZIP
I created an application that was made available for download within a .zip. Within the .zip has a .exe and some files needed to perform an installation. So far so good. However some users do not…
-
2
votes1
answer1354
viewsQ: Text break in Windows Reporting (RDLC) column
I have a report that has the structure below: And almost everything works properly. But when the answer text of a question is too large (there is no character limit) the entire line (of the report)…
-
1
votes1
answer640
viewsA: Dates with JSON /Highcharts
You are passing the data to the graph as pure JSON, you must convert to an object, which will be a array with the data. To convert do the following: series: [{ name: 'Atendimento Particular', data:…
-
0
votes3
answers241
viewsA: URL of route being incorrectly mounted
I believe the routing is being generated wrong because you are using the two actions with the same name, just changing the data type, however when generating the routing the data type received is…
-
1
votes4
answers7370
viewsA: Validate content from Textbox
I had to do this on a recent project. What I did was use the event Leave of TextBox to validate the data using REGEX. public const string EXPRESSAO = @"^\d+(\,\d{1,2})?$"; //Expressão para validar…
-
1
votes1
answer587
viewsA: How to communicate a local application with an open web page in the browser?
There’s a way to do something similar. With an application WindowsForms you can make a simple form that will contain a component webBrowser and with it you can use C# itself to perform the printer…
-
1
votes2
answers2761
viewsA: Do not display null value (01/01/0001) of a Datetime in a Datagridview
EDIT: Sorry, I had not seen that I was using databinding, in this case I think my solution does not apply, but it is valid for other cases. You can do something like: if (data != DateTime.MinValue)…
-
1
votes2
answers6198
viewsA: Error Could not load file or Assembly Microsoft.Web.Infrastructure
This is because the server you are using does not have some files that are needed to run your application. You can take the project dependencies and put them together in the bin folder. You select…
-
12
votes3
answers1320
viewsA: What are braces {} in an SQL string for?
Using double-quoted keys allows calling methods to generate a value to be concatenated into the string. It is valid to remember that it will work only with double quotes. In this your example you…
-
1
votes1
answer1867
viewsA: Ways to create combobox using AJAX to fill
I’m not sure this is your case, but I’ve had some similar problems in the past. When DOM is formed if your element has not been loaded Jquery events will not be recognized. To illustrate let’s see…
-
5
votes1
answer1710
viewsQ: Connection error
I am creating a Windows Forms application using C# and am having a problem connecting to SQL Server CE 4.0. The application database is in the folder AppData of the logged-in user. To get the folder…
-
0
votes1
answer247
viewsQ: Large volume data loading with Nhibernate + Windows Forms
I use the ORM Nhibernate in a windows Forms project and there is a forecast to work with a large volume of data in several tables, ranging from 1 to 15 thousand records on average. Although it is…
-
3
votes1
answer2186
viewsQ: How to use generic types with type parameters?
I have a dictionary that serves as a type mapper with C#. var Map = new Dictionary<Type, Type>() { {typeof(A1), typeof(A2)}, {typeof(B1), typeof(B2)}, {typeof(C1), typeof(C2)}, {typeof(D1),…
-
1
votes2
answers648
viewsA: Jquery validation in mvc fields
If you are using ASP . NET MVC you can decorate its properties with [Required(Errormessage = "Campo obrigatório")] that the framework itself said, provided that jquery validity is loaded at the time…