Posts by Ricardo • 5,680 points
191 posts
-
1
votes1
answer49
viewsA: My application saves blank data, I would like validation to prevent saving empty fields
Places a Return inside the if for each validation: if (cli.getNome().equals("")) { edNome.setError("Preencha o nome"); return; I don’t know if there is any framework to validate on androi, I don’t…
-
2
votes1
answer123
viewsA: If and Else problem when validating Edittext fields in the android app
The keys are wrong here: if (cli.getId() > 0) { getCliDao().alterar(cli); } ToastManager.show(getBaseContext(), "Salvo com Sucesso", ToastManager.INFORMATION); else {…
-
0
votes2
answers3501
views -
0
votes1
answer333
viewsA: How to add scrollbar in Datagridview VB?
The scroll of datagridview appears when it is with records that no longer fit on the screen. Create a new form and add a new one datagridview Put this code in the load. string[] row0 = {…
-
1
votes1
answer257
viewsA: How do you set the order by command?
Takes the and Stay like this: select * from emp where ndep in(10,30) order by ndep desc; Fiddle with SQL running here.…
-
6
votes1
answer250
viewsQ: How to unify two Csss files
I’m doing a project Spring MVC 4.2. In this project I have more than one file CSS and more than one JS. What I want is to transform all the files Csss in a single ALL.css and that this file is…
-
2
votes1
answer95
viewsA: Refresh page information without refreesh
You can use Websocket in HTML 5. Introducing Websocket The Websocket specification defines an API that establishes "socket" connections between a web browser and a server. In other words, there is a…
-
1
votes2
answers209
viewsA: Relate and compare Mysql and VB6
Reading your question and especially this comment: Oops, the idea would be to generate a report listing all the items from vendaesc, as there may be several items in vendaesc for a sale, I need the…
-
7
votes1
answer739
viewsA: How to show the number of Mysql repetitions?
Make an SQL this way. Put limit 2 at the end to make it easier to assemble the fiddle. In your case uses limit 5. select n.sobrenome, count(*) from nomes n group by n.sobrenome order by count(*)…
-
1
votes3
answers1239
viewsA: SELECT with 2 tables and same field in both
I’d wear a Union in two selects once I didn’t understand how to do the join of the tables: (SELECT iv.campo1, iv.campo2 FROM imoveisvenda iv WHERE iv.dormitorios = 3) UNION (SELECT il.campo1,…
-
1
votes2
answers258
viewsA: Mysql, selecting 4 related tables
I changed SQL, at first I didn’t see the flaw in jois, you’re trying to make left join of everything with the table morador. I think the broker would be the SQL below, change the alias name to what…
-
0
votes1
answer43
viewsA: Frequently troubling the generation of a sitemap
You can use the Easysitemap to generate the new sitemap.xml, it even generates the index if more than one site map file is needed. I use with the Hangfire and it generates time to time. But you can…
-
2
votes2
answers1154
viewsA: Using distinct with Entity Framework
It considers all columns that are in select. Select Data, Descricao from .... data1 teste data2 teste data3 teste data4 teste In that case the distinct would change nothing in the result.…
-
1
votes1
answer529
viewsA: Error 500 when trying to give a post from a JSON to the web service C#
The first thing I would do: <configuration> <system.web> <httpRuntime maxMessageLength="409600" executionTimeoutInSeconds="300"/> </system.web> </configuration> If you…
-
4
votes1
answer462
viewsA: Access MDF database from executable folder
Recording the solution in the answer: con.ConnectionString = @"Data Source=(LocalDB)\v11.0; AttachDbFilename=|DataDirectory|\he_dados.mdf; Integrated Security=True; Connect Timeout=30";…
-
0
votes1
answer68
viewsA: Spring MVC with plugin Minify-Maven-plugin does not recognize the <id> tag
I forgot to tag <execution> <executions> <execution> <id>default-minify</id> <configuration> Just include that it worked.…
-
0
votes1
answer68
viewsQ: Spring MVC with plugin Minify-Maven-plugin does not recognize the <id> tag
I created a Hello World here with Spring MVC to study the technology and put some client sites on a java server that I have. Everything has working, but some sites have many files css and js, so I…
-
0
votes2
answers46
viewsA: ID is null when I enter the details by index
In my experience I can tell you the following. If you change the URL to : http://localhost:17542/Availability/Details? id=0 It’ll work the way it is... Now, to make this question URL work just put…
-
1
votes2
answers146
viewsA: Context trying to delete the same record twice
Putting your code makes it easier to point out the problem. What seems to be happening to you is this. Contexto.Objetos.Remove(instancia1); Contexto.SaveChanges(); Error... After the mistake you…
-
3
votes1
answer521
viewsA: Check if object is part of class that implements certain interface
Behold that answer also, follows the examples: interface I1 { } interface I2 { } class C implements I1, I2 { } C c = new C(); boolean isC = (c instanceof C); //true boolean isI1 = (c instanceof I1);…
-
1
votes1
answer61
viewsA: What is the correct way to legitimize a particular user through Identity with Soap web service?
Identity is used in MVC, in Webservice this works different, each request in WS is a new request, different from when you are running some site on IIS. One-night stand here you will understand how…
-
1
votes2
answers319
viewsA: ASP.NET MVC Bootstrap Access Control Edition
Just you change the DefaultConnection to point to your bank, it will create all tables (all from scratch). <add name="DefaultConnection" connectionString="Data Source=IP;Initial…
asp.net-mvc-5answered Ricardo 5,680 -
2
votes1
answer872
viewsA: How to read a file with moon?
Do a function to do it like this: function file_getdata() local data_file_path = gre.SCRIPT_ROOT .. "/myfile.json" local f = io.open(data_file_path) f = io.read("*all") f = io.close() return f end…
-
3
votes1
answer66
viewsA: Jsonreaderexception when performing Jobject.Parse
You have to use Jarray. JArray v = JArray.Parse(s); With it will catch a json q is a collection. You can pick up the item like this: var item = v[0]["modid"].ToString(); And so it goes. Or take the…
-
5
votes3
answers7687
viewsA: Delete duplicate record from table in Postgresql
Do it like this: DELETE a FROM nomes AS a, nomes AS b WHERE a.nome=b.nome AND a.id < b.id Code find here. UPDATING To postgresql 9.3 would do so: (Here a working Fiddle) DELETE FROM tb_kardex a…
-
2
votes2
answers62
viewsA: co-pilots who made the most flights
If it’s Slqserver it looks like this: SELECT TOP 1 t.nome , p1.n_horas_voo , COUNT( * ) as n_de_voos FROM Tripulante t , Piloto p1 , Voo v WHERE t.id = v.id_copiloto AND v.id_copiloto = p1.id GROUP…
-
2
votes2
answers271
viewsA: Change Order by Clicking the Tab Key
You can use the attribute tabindex="2" in HTML. Example <!DOCTYPE html> <html> <body> <a href="http://www.w3schools.com/" tabindex="2">W3Schools</a><br> <a…
-
4
votes1
answer87
viewsA: Convert SQL script to Linq
Would look like this: var reg = (from p in list where p.ID_Pessoa == item.ID_Pessoa && p.ID_ArquivoPagamento == ID_ArquivoPagamento group p by new { p.ID_Pessoa, p.ID_ArquivoPagamento } into…
-
14
votes6
answers502
viewsA: Empty semicolon doesn’t make a mistake?
Between the closing of the if which is the } and the ; inserted is a block of code that does nothing. Same thing between a ; and another ;…
-
3
votes2
answers1919
viewsA: When should I use GC.Suppressfinalize()?
It should be used when the class is finished. When using the recommendation is to use an implementation of IDisposable: This is an implementation I did on a project: public void Dispose() {…
-
2
votes3
answers352
viewsA: Close the panel when the mouse exits from the top
You can use this: private void panel1_MouseLeave(object sender, EventArgs e) { panel1.Visible = false; } But if you have a label inside the panel it will disappear if you pass the mause on top of…
-
2
votes1
answer384
viewsA: How to delete information in BD using Datagridview?
To take the value of datagrid would just be that: var valordacelular = DataGridView3.CurrentCell.Value; It is not indicated that you concatenate the direct value in string do not, below how your…
-
4
votes3
answers1779
viewsA: How to do that by clicking a key a Submit is sent
You can do it like this: (source) $("#id_of_textbox").keyup(function(event){ if(event.keyCode == 13){ $("#id_of_button").click(); } });…
-
3
votes2
answers1744
viewsQ: How to change the name property in @Html.Editorfor
I have the following class: public class ModelHome { [Required] [Display(Name = "Nome")] public string Nome { get; set; } [Required] [Display(Name = "Email")] public string Email { get; set; }…
-
0
votes3
answers237
viewsA: Doubt with pagination in Asp.net
I can’t tell you why he used Math.Ceil in that response code. I believe what you want is this class (Math) in C# which in turn has the method Ceiling. Math.Ceil you will find in Javascript. On the…
-
0
votes2
answers213
viewsA: Function with in_array is not working
The in_array function does not expect to receive two arrays, you can create a function to do this check. This function below returns true if any content of $array1 exist within $array2. I do not…
-
2
votes2
answers2143
viewsA: What is the difference between . save() and . update() in Django?
There are several differences between the two. The Update can be used to update various objects, the Save works to save a single line in the bank. In the case of multiple Update will give you much…
-
2
votes1
answer3029
viewsA: How to compare the last character of a string with some letter or accent
You can do it like this: var minhaString = "Qual o último char?"; if (minhaString.EndsWith("?")) { Console.WriteLine("O último char é '?'"); } Here it is running on fiddle…
-
2
votes1
answer83
viewsA: How to perform an arithmetic operation without ordering it in GROUP BY
You can make a select out of everything with the fields grouped. Without seeing the entire SLQ I won’t be able to guarantee 100%, but this would be a solution: SELECT cod_representante ,…
-
0
votes1
answer972
viewsA: Send list of JSON c#objects
The name of the Json fields must match the object properties names, this is how the framework does the automatic conversion. In case of question Json has Answer and Controller expects Resp. Since it…
-
2
votes1
answer180
viewsA: Manipulate json with ajax and use your data separately
Without having the right data from your Json it is difficult to build a code for your specific case, so I’ll put an example of how you can use a Json and then you adapt it to your case, ok? In it we…
-
3
votes3
answers742
viewsA: How to check if a value is present within an array?
Instead of you turning an array into a string with separate numbers with comma you can use the function in_array: <?php $os = array("Mac", "NT", "Irix", "Linux"); if (in_array("Irix", $os)) {…
-
4
votes1
answer3986
viewsQ: How to align checkbox and label with bootstrap
The result of this my form puts the checkbox and Abels in line, which is correct, but I can’t find a bootstrap class that makes the label aligned with the checkbox. How do I do it? <script…
-
2
votes1
answer435
viewsA: SQL Query Returned Null, Empty for JSON
Putting the result of the comments in the reply: For Json to work in PHP you need Encode utf8. In the above case just put utf8_encode(string), in the strings coming from the query when mounting the…
-
1
votes2
answers5024
viewsA: Difficulty putting a color in the CSS font
Put it like this: .navbar ul li a { display: block; width: 100px; text-align: center; text-decoration: none; color:#fff; } I made a fiddle for you to see. In the fiddle the Home disappears because…
-
1
votes4
answers4991
viewsA: Datatable does not order correctly
I believe your problem is the lack of Jquery Javascript loading for Datatable, this is it: https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js I made two Fiddles for you, one without…
-
6
votes2
answers2342
viewsA: Percentage function in PHP
Considering what you said in your question comment would look like this: $valor = 100; // valor total $porcent = 10 / 100; // 10% $resultado = $porcent * $valor; echo "10% de 100 é: " . $resultado;…
-
5
votes2
answers23371
viewsA: How does the BLOB field work?
The blob (Binary Large Object - large binary object) serves to store any kind of data, videos, images, sounds, etc. This 80 you are viewing is the default SIZE SEGMENT used in field creation.…
-
5
votes2
answers2815
viewsA: Deleting data automatically after certain time
Usa create-Event. Would be more or less thus: Create the process: CREATE PROCEDURE delete_rows_links() BEGIN DELETE FROM minhatabela WHERE categoria = 1 AND data < CURRENT_DATE()-10; END CREATE…
-
1
votes1
answer60
viewsA: Why is Jobscheduler running without the cell phone is charging?
I found the problem with this class. That one Issue is open for a year and it seems that it has not yet been resolved. As soon as I have an update on the date of a possible update I will edit this…