Posts by Rodolpho Sa • 482 points
25 posts
-
4
votes2
answers287
viewsA: How to add methods to a native class?
I believe what you’re looking for is called Extension Methods. See more in : Extension methods ! Using this concept, you can create extensions for all classes and structures, as long as they are not…
-
0
votes1
answer234
viewsA: Error running SQL "Create Trigger..." inside a C#application
I did it and it worked. A tip is to try to simplify your command (in case Trigger) to ensure that the problem is not there. I created the tables below: create table [dbo].TB_TESTE( id int identity ,…
-
1
votes1
answer353
viewsQ: How to access properties with "." in the name on a Dynamic object
I have the following JSON object: { "odata.metadata":"httpXXXXX", "odata.count":1443, "value":[ { "codigo" : 1 , "nome" : "ABS"} ] } and create an object like this: dynamic categorias =…
-
1
votes1
answer51
viewsA: Sql server 2008 connection
Make sure you didn’t just install Management Studio. Make sure you also installed Server. Check if in the installation, you used for instance or in Default. Check that the service has started: If…
sql-serveranswered Rodolpho Sa 482 -
0
votes1
answer54
viewsA: How to create dependencies between Jobs on Quartz.NET
So I researched, using Jobchainingjoblistener it is possible to chain the execution of Jobs and it already solves my problem. It is also possible, in the worst case create a listener at hand using…
-
0
votes1
answer54
viewsQ: How to create dependencies between Jobs on Quartz.NET
I have a Windows Services where I use Quartz.NET to schedule tasks on my system, but there are tasks that can only be performed after the (successful) completion of another. I found no documentation…
-
1
votes1
answer107
viewsA: Entity Framework + Fluent API + Web API?
Try changing your method with: public IQueryable<Product> GetProducts() { db.Configuration.ProxyCreationEnabled = false; var query = from r in db.Products.Include("Category") select r; return…
-
0
votes1
answer61
viewsA: Move button controls in a Windows Forms application inside a panel container
private void Form1_Load(object sender, EventArgs e) { panel1.AllowDrop = true; panel1.DragEnter += Panel1_DragEnter; panel1.DragDrop += Panel1_DragDrop; button2.MouseDown += Button2_MouseDown; }…
-
4
votes5
answers16830
viewsA: How do I list all tables with their respective databases?
I believe you can use something like this: declare @BaseName varchar(100); Declare @SelectTables varchar(1000); --Primeiro obtenho em um cursor a lista dos banco de dados existentes declare C_bases…
-
2
votes1
answer986
viewsA: Configure HTTPS in Webapi
Following link with 2 very interesting materials on the subject: Working with SSL in Web API https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/working-with-ssl-in-web-api and Using…
-
1
votes1
answer7024
viewsA: Paint cell with conditional formatting using SE
Use conditional formatting option: To paint green use another format condition with the "Larger Than" and ask to paint green.…
excelanswered Rodolpho Sa 482 -
1
votes1
answer294
viewsA: Display Name with Razor
Try something like that: public static string GetDescription(this System.Enum en) { Type type = en.GetType(); MemberInfo[] memberInfo = type.GetMember(en.ToString()); if (memberInfo != null…
-
0
votes2
answers594
viewsA: error GET method while consuming Webapi
I believe this is because the property categoria1 is of the same type as the class in question. Try adding the attribute below in the class : [JsonObject(IsReference = true)]…
-
0
votes1
answer492
viewsA: Composite key with EF Fluentapi
Does it have to be effluent? I usually do by notation, see: public class Estoque { [Key, Column(Order = 1)] public int ProductID { get; set; } [Key,Column(Order = 2)] public int FilialID { get; set;…
-
1
votes1
answer1431
viewsA: HOW TO MAKE A Getasync in an ASP.NET API by passing an object as a parameter?
Try something like that: using (var http = new HttpClient()) { var url = new Uri("http://localhost:50501/api/values/ListaContatos?id=1&nome=teste"); var result =…
-
1
votes1
answer1961
viewsA: how to calculate the storage volume of a database
First you need to identify the size in bytes of each row. With this you will be able to identify, given the number of rows in the table, the size of the table. In Oracle I use q query below to get…
-
0
votes2
answers548
viewsA: Rows in Columns (SQL)
An option would be like this: select a.id , sCol001.code_sample as code_sample_1, sCol002.code_sample as code_sample_2, sCol003.code_sample as code_sample_3, sCol004.code_sample as code_sample_4,…
-
0
votes4
answers2106
viewsA: Value treatment null c#
If you are using Visual Studio from version 2015: public string CarregaProdutosDermaClube(string codigoproduto) { //consulta os dados var tbuscar = new BuscaProdutosDermaClubeDAL(); var retorno =…
-
0
votes6
answers32941
viewsA: Convert varchar to date in SQL
If you are in SQL and considering that the dt_item field is of date type, to perform the query you can do so: select * from TAB_FATURAMENTO where cd_cliente like '%' and dt_item between '2017-05-15'…
-
3
votes3
answers1052
viewsA: How to filter a list type Ienumerable<> through another Ienumerable<>?
You can use something like this to get a more complete object : var query = from r in pMundo join l in mundo on new { r.MundoId, r.ContinenteId, r.PaisId, r.UFId } equals new { l.MundoId,…
-
0
votes1
answer129
viewsA: Customized Webapi Response
See if this is something you need: [HttpPost] public IHttpActionResult Post([FromBody]DateTime newDate) { return Ok<DateTime>(newDate); } The method OK<T>() is within the class…
-
1
votes1
answer71
viewsA: Relationship between four tables
I believe something like this will solve you: SELECT t.titulo, cord.nome as nome_coordenador, inst.nome as nome_instrutor FROM treinamentos t LEFT JOIN treinamentos_has_coordenador tc ON…
mysqlanswered Rodolpho Sa 482 -
0
votes1
answer202
viewsA: Return data from an N:N table only with foreign keys
I believe you can wear something like this: select lp.idProduto, pd.nome_produto, lp.[idPeças] , pc.[nome_peça] from [lista_peça] lp inner join produto pd on pd.idProduto = lp.idProduto inner join…
sqlanswered Rodolpho Sa 482 -
3
votes1
answer999
viewsQ: Working with directory with special characters
I have the following script: $ExistPath = Test-Path -PathType container C:\Publicação\SQL-Release\Services if ($ExistPath) { Write-Host "Removendo diretorio!" Remove-Item -Path…
powershellasked Rodolpho Sa 482 -
0
votes2
answers121
viewsA: How to screen a serialized object?
Try placing the attribute below in the classes you want to serialize: [JsonObject(IsReference = true)] public class Eventos : IEntidade<EventosAuditoria> { ... } and [JsonObject(IsReference =…