Posts by Ricardo • 5,680 points
191 posts
-
2
votes2
answers156
viewsQ: Error: Cannot find data type long
I am trying to create a precedent in SQL Server 2012, but it is giving the following error in signing it. Mensagem 2715, Nível 16, Estado 3, Procedimento MINHAPROCEDURE, Linha 6 Column, parameter,…
-
1
votes1
answer446
viewsQ: How to convert Json to Object where the column name is a variable number using Httpresponsemessage
I have the following Json: {"video":{"duration":"23:16","views":"2358","video_id":"1235288","rating":"5.00","ratings":"3","title":"titulo do…
-
0
votes3
answers258
viewsA: How to generate SQL in relationship table without repeating values?
I was able to build with the help of Entity Framework and the rest I finished myself. Follows the solution: select v.url, c.id, c.description from ( select top 120 a.id_video, max(id_categoria) as…
-
0
votes3
answers258
viewsQ: How to generate SQL in relationship table without repeating values?
I have the following scenario: Tables: Video (id, url) VideoCategoria (id, id_video, id_categoria) Categoria (id, descricao) I need to get the last 120 categories that received videos. On the same…
-
4
votes1
answer156
viewsQ: Regular Expression, picking numbers between two predefined texts
I need to withdraw números of a string. To string follows a pattern: http://www.meudominio.com/1789519-texto The number will always be between / and - I’ve already reached the following formula:…
-
1
votes1
answer80
viewsA: Httpcontext.Current.Request.Islocal does not work in the Startup class
The Startup class runs when the server goes up, and this is done by the very machine the server is running. That’s why Islocal will always return true... The Islocal Property Returns true if the IP…
asp.net-web-apianswered Ricardo 5,680 -
3
votes1
answer214
viewsQ: Regular expression, picking numbers before a text
I wanted a regular expression to catch the minutes in a string with this format: 1 min 10 min I made that expression. \d(?= min) The problem is that it only takes the last number, the closest to the…
-
2
votes1
answer170
viewsA: EF is giving Timeout in a query that should be instantaneous
The solution to the case presented in the question was the change of the column being ordered. Of: ORDER BY [Project1].[DT_INCLUIDO_BD] DESC To: ORDER BY [Project1].[ID] DESC What I could understand…
-
3
votes1
answer484
viewsQ: Changing the text of a Textview that is inside an Arrayadapter entry
I made a Adapter that extends of ArrayAdapter. My layout contains only a series of TextViews, one below the other, very simple. I want some event in the system to be watched by my Adapter and that a…
-
5
votes1
answer170
viewsQ: EF is giving Timeout in a query that should be instantaneous
When I run the SQL generated by the direct EF on Sqlserver it runs with less than 1 second. When it runs through the timeout application it takes more than 30 seconds. I’ve seen a lot of this…
-
1
votes1
answer80
viewsQ: Httpcontext.Current.Request.Islocal does not work in the Startup class
I’m trying to use HttpContext.Current.Request.IsLocal; in an application web api 2 in class Startup method Configuration(IAppBuilder app). The idea is to just upload a server hangfire if it’s in…
asp.net-web-apiasked Ricardo 5,680 -
2
votes1
answer718
viewsQ: How to create button in a Simpleadapter with event click excluding item
I set up a list in an android app that is a simple list using SimpleAdapter. What I need now is to delete the item from the list, but I don’t know how I would do it because I couldn’t get the…
-
0
votes1
answer82
viewsQ: Run scheduled time routine on time with android
I’m working on an android app that needs to check an X URL in X times. The only way I found to schedule tasks would be with the class AlarmManager, this really would be the right way? Someone…
-
0
votes1
answer154
viewsA: Mysql with Entity framework Code First ID skipping 10
There is a variable that controls this: autoincrement See if you can identify her value like this: SELECT Auto_increment FROM information_schema.tables WHERE table_name='the_table_you_want'; To…
-
5
votes1
answer1413
viewsQ: How to make visual studio 2015 publish only the files that are most current?
I put a project in visual studio 2015 to try the tool. It is an Asp.net mvc application, I publish it directly to the server by FTP. Right click on the project, Publish, then I created an FTP…
-
2
votes1
answer246
viewsQ: How not to publish an Asp.net mvc configuration file
I’m separating my web.config in several files, for example, there is now connections.config that my web.config reference as follows <connectionStrings configSource="connections.config"/> I…
asp.net-mvcasked Ricardo 5,680 -
1
votes0
answers204
viewsQ: How to delete duplicate records in a Sqlserver table
I have a table where I need to apply a new watering, column A + B cannot have the same value. I intend to add a rule like that: ALTER TABLE minhatabela ADD CONSTRAINT minhaconstraintnome UNIQUE…
-
5
votes1
answer44
viewsQ: Entity Framework 6 error logging in Sqls
I’m trying to see the Sqls run by Entity Framework, use version 6. I’m following this guide. I made a new Dbcontext using the graphical interface. 5 tables only. The code is inside an API2 Web…
-
3
votes2
answers211
viewsQ: Entity Framework 6 Async and method . Wait()
I have a system that is a Web Api, the control runs a classes like this: public class CrawlBO { public void IniciaProcesso() { ... CarregaConfiguracaoCrawlBO carregaconfiguracaocrawlbo = new…
-
0
votes1
answer2004
viewsQ: Place search form on the right of the navbar
I’m using Bootstrap and put a search form inside a simple navbar. The problem is that I can’t get the form away from the title, I’d like it to be aligned to the right of the navbar. This is the…
-
2
votes2
answers100
viewsA: Extension Methods in . NET does not work
I am putting the answer that the ramaral put in the comments, when he create his answer here I mark his as correct answer. The solution is to add the namespace using MEUPROJETO.Extension where I…
-
4
votes2
answers258
viewsQ: Global Exception Handling with Web API 2
I’m willing to use the Global Error Handling with Webapi 2. I created a new project, within it I created the following class: Errologteste.Cs using System; using System.Collections.Generic; using…
-
1
votes2
answers100
viewsQ: Extension Methods in . NET does not work
I’m trying to create a Extension Methods for the class string. He’s not showing up. My class with the extension method: namespace MEUPROJETO.Extension { public static class StringExtension { public…
-
4
votes1
answer2448
viewsQ: Changing Routes with Asp.Net MVC
I’m trying to change a route in my project, the control is like this: public class TagController : Controller { // GET: Tag private MYEntities db = new MYEntities (); [Route("tags")]…
-
5
votes2
answers998
viewsQ: Regular expression, taking values from HTML
I have an HTML that I need to remove values from a set of <li>. This is the HTML part: <ul id="minhas-tags"> <li><em>Tagged: </em></li> <li><a…
-
4
votes1
answer15857
viewsA: Create primary key in a table that already exists in sqlserver
To generate the column just do the following: First create a column with auto increment: alter table TABELA add id [bigint] IDENTITY(1,1) Then turn this column into a primary key. ALTER TABLE TABELA…
sql-serveranswered Ricardo 5,680 -
4
votes1
answer15857
viewsQ: Create primary key in a table that already exists in sqlserver
I imported a file txt with six million lines for a Sqlserver table. Now I want to create a primary key in it, the problem is that no column guarantees integrity, so I want to create another column…
sql-serverasked Ricardo 5,680 -
7
votes2
answers6238
viewsQ: How to know if the file is being used by another process before trying to read
My system does N jobs on top of a list of files, eventually I get this exception: System.IO.Ioexception: Process cannot access file 'C: XXXXXX xxxx.xxx' because it is being used by another process.…
-
4
votes1
answer4562
viewsQ: How to exit a method before ending in c#
What should I do to stop the execution of a method before it ends, get out and continue the execution? public void MEUMETODO() { ... PARA E SAIR AQUI(); ... }…
-
2
votes1
answer780
viewsQ: How to capture an error occurring on a webapi server?
I have a server where runs a Webapi service, in the client I run the call to a POST URL so: try { HttpWebRequest request; request = (HttpWebRequest)WebRequest.Create(URL); request.Method = "POST";…
-
4
votes1
answer1334
viewsQ: How to read all bytes of a file
I have a question in Readbytes(int) My code is like this: BinaryReader r = new BinaryReader (File.OpenRead(ARQUIVO)); byte[] arraybyte = r.ReadBytes(100000); That one 100000 which I put is because I…
-
6
votes1
answer660
viewsQ: How to send Winform images to a Webapi service c# on both sides
I have two apps, a local running Winform and a remote hosted Webapi. Already send data to the served from Winform, the code is like this: JavaScriptSerializer json_serializer = new…
-
2
votes1
answer86
viewsQ: Convert.Todatetime returns the previous day
Using C#, when I run it: Convert.ToDateTime("Wed, 20 May 2015 01:36:39 +0000") He returns it to me: {19/05/2015 22:36:39} Date: {19/05/2015 00:00:00} How does it return the correct value?…
-
3
votes1
answer967
viewsQ: Update to remove a piece of a varchar field
I have a column with a varchar field. In this column has a value like this: http://dominio/img//12.jpg I want to do an update that leaves this field like this: http://dominio/img/12.jpg That // I…
-
1
votes1
answer2031
viewsQ: How to list all files from a server directory in ASP.NET MVC?
I want to know how to create a List<string> with the filenames of a given directory. The service is hosted on a shared server, published in my httpdocs. I have several images inside…
-
2
votes1
answer42
viewsQ: Sqlserver 2012 - Column '' in table '' is of a type that is invalid for use as a key column in an index
After seeing this error when creating a NONCLUSTERED index I wondered if it would really be necessary to create this index in the following scenario: I have a table with 11 columns, a column I save…
-
4
votes1
answer1174
viewsQ: Razor C# list and sublist with List<String> (originally "how to check if an HTML element already exists")
I need to know if an HTML element already exists, in my loop, if it exists I use it, if it doesn’t exist I create a. How would you do it inside a @foreach (var item in Model){ ... } Following the…
-
2
votes1
answer1327
viewsQ: text-overflow: Ellipsis - Displaying text when mouse over
I made appear "..." at the end of a very large title, when I hover over it I can already make it display the rest of the title, but it does not use a line break. How do I want it to work? When…
-
2
votes1
answer3605
viewsQ: A cursor inside another sqlserver cursor
I know I could do a tab1 Join with tab2, but that wouldn’t be the case, I need both cursors. When I run I get error from: A cursor with the name 'cursor_tab2 ' already exists. The cursor is already…
-
4
votes1
answer119
viewsQ: Asp.Net MVC with two views and a URL
I made a website that should work with the following configuration. Navbar on top, that’s okay. Below it I have a container div, it is divided into two parts, the left part is a list of, can be…
asp.net-mvcasked Ricardo 5,680 -
1
votes1
answer387
viewsQ: C#. 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…