Posts by George Wurthmann • 4,415 points
170 posts
-
3
votes2
answers1074
viewsA: Inner Join no entityframework
You can (or even should) specify the relationship between the entities. You can do this by adding the following line to the Products: [ForeignKey("Id")] public Produtos Produtos { get; set; } Would…
-
0
votes2
answers548
viewsA: Send object list to View, by Viewbag Asp.net
You can select Colors and Sizes from your var geral. Thus: var geral = db.ProdutoDb.Where(x => x.CodProduto == produto.CodProduto); ViewBag.TodasCores = geral.Where(x => x.CodProduto ==…
-
1
votes2
answers43
viewsA: Object attributes coming null in Query
These objects are not being loaded probably because you didn’t use the ICollection<T> to inform you that you want to do Lazy Loading. Probably the Tamanho must be coming null too. Add the…
-
1
votes2
answers209
viewsA: Add subitems between groups with Linnus
Note that in the example below I am using an example class and hypothetical fields of your class. But I believe that only the code below meets your need, if your return on listPlanoDeContas for what…
-
1
votes1
answer415
viewsA: Delete Regedit Key Windows
First, add this reference: using Microsoft.Win32; And to delete use this snippet: string keyName = @"SOFTWARE\Microsoft\MSLicensing"; RegistryKey key = Registry.CurrentUser.OpenSubKey(keyName,…
c#answered George Wurthmann 4,415 -
2
votes1
answer645
viewsA: Create Dropdownlist with Viewbag
The error may be occurring because your ViewBag.Office is varied (null). To avoid the problem you can treat the field in some ways. 1- Example to put a generic value in the list in the controller:…
-
0
votes1
answer40
viewsA: Recover from Oracle Dump
Have you tried using the command impdp? I found the following example: impdp SPEND_DBA/SPEND_DBA@ SPEND102 directory=dump dumpfile=SeuArquivoDump.dmp logfile=SeuArquivoDeLog.log To see the full…
-
0
votes2
answers401
viewsA: Controller Dynamic Fields - ASP.NET MVC
If you’re using a model you can do something like this: <button type="button" onclick="formToJson('@Html.Raw(Json.Encode(Model))')"> Cadastrar </button> Or try changing your "formToJson"…
-
2
votes1
answer140
viewsA: Problems when creating crud, select and Insert works, delete and update does not
In the method that deletes and updates you are overriding its parameter @CodigoCid always by "0". As it should not exist in the bank never deletes or updates anything. To work there should be a…
c#answered George Wurthmann 4,415 -
1
votes1
answer68
viewsQ: Keep stack trace when the method gives rethrow in the captured Exception
I ran the Visual Studio Code Analysis application and in several methods received the following message: CA2200 Rethrow to preserve stack Details 'fooBLO.Foomethod(Dadosprojectdto, string)' rethrows…
-
2
votes1
answer1635
viewsA: Return Controller List to View
For this case (List errors), Validationsummary is the best option. To use it, in your View just add this where the Error Summary should appear: @Html.ValidationSummary(true, "", new { @class =…
-
2
votes2
answers879
viewsA: Linkedin profile plugin on web page
But just copy it. You may have some problem due to security. In fiddle, for example, it is likely not to accept because the external content does not use SSL. But test yourself on Tryit do W3C, for…
-
1
votes1
answer149
viewsA: How to Recover SQL Server Data Correctly?
The problem occurred because I removed my field from the View and has nothing to do with the date format in SQL Server. I put the field back on View as readonly: <div class="form-group">…
-
0
votes1
answer149
viewsQ: How to Recover SQL Server Data Correctly?
I created a CRUD simple using the ASP.NET MVC and I can save my logs normally. If I look in the database, my date (Dating) was stored like this: 2017-06-01 00: 01: 23.750 But when I try edit the…
-
2
votes2
answers1339
viewsA: Open PDF in browser automatically after download
Instead of returning File, return FileStreamResult. How the file is in byte[], will need to do this to pass to MemoryStream: byte[] arquivo = pdf; MemoryStream pdfStream = new MemoryStream();…
-
1
votes1
answer80
viewsA: Project default is not found
The nuget installed is compatible with the project? Check which version of Nuget is installed in your project and which frameworks support it. After that follow the steps below to see if you can…
-
4
votes6
answers32941
viewsA: Convert varchar to date in SQL
Use the CONVERT select * from TAB_FATURAMENTO where cd_cliente like '%' and dt_item between CONVERT(varchar(10), '15/05/2017', 103) and CONVERT(varchar(10), '31/05/2017', 103); The value 103 defines…
-
2
votes1
answer1305
viewsA: Generate more than one PDF in memory and export it in a compressed file
The code is very similar to the of that answer. Important to say that you are using System.IO.Compression for native compression with C#. This should work in your code: public ActionResult…
-
2
votes1
answer1118
viewsA: Return Dowload Excel via MVC Controller
In his return File no error is occurring probably because the return of the object is being null, is still a problem, but there is a Exception Handling in this case and no exception is played as the…
-
1
votes1
answer631
viewsA: Error converting HTML to PDF using Xmlworkerhelper
How can I get around this problem ? The correct way to get around your problem is to attack the root of it. That is, you should fix your HTMLs so that the tool can work properly. Something that can…
-
2
votes1
answer375
viewsA: With export HTML string to PDF Compressed (zip)
The PDF you can generate with the iTextSharp, is quite simple. The Zip can be generated natively by C# with the System.IO.Compression. So you’re gonna need referral: using iTextSharp.text; using…
-
5
votes2
answers2067
viewsA: Order change of Sql columns?
You can switch to Design View as long as you turn off the option "Avoid saving changes that require table recreation". This option is in Tools > Options > Designers: After this open the table…
-
1
votes2
answers161
viewsA: Oracle DB and MVC 4 showing ORA-06413 error
Possible causes: Using an unsupported version of Oracle Client (older than 11.2) on Windows 7 or above. As DLLs of a previous Oracle Client installation were left in the system, causing a conflict.…
-
2
votes1
answer66
viewsA: How to recover all checkbox
I think it’s not the best way, but you can find it that way: CheckBox chkCheckMed= (CheckBox)PanelBar.FindControl("CheckMed"); PanelBar is just an example. You should place your items inside a Panel…
-
3
votes1
answer230
viewsQ: Should I add the . suo file to my source control?
Visual Studio has a file with the extension .suo that saves some project options. What is this file and what options it stores? This file should be added to the project in TFS, SVN or any other…
-
1
votes1
answer76
viewsA: Query Rows having Maximum value in a column
In the example below see that the Channel To and the Canal B appear to more than one store, but only the store that sold more for this channel will be shown: WITH table_(ID_Loja, Canal, Valor_Venda)…
-
0
votes1
answer51
viewsA: VB.NET Datagridview error
This error means exactly what is written on it: There is no line at zero position To solve it is also simple: Before making the assignment that is in the error line, validate if the line you are…
-
0
votes4
answers1260
viewsA: Footer always at the bottom of the page
You didn’t post your HTML, but if you are using bootstrap, you can simply create a new Row below the body of the page. Do something like this in your HTML: <body> <div class="navbar…
-
2
votes2
answers1454
viewsA: apply filter in return from a list
You can use the Contains to filter the list according to the situations that are in the array, thus: var array = GetSituacoes(); var lista = bll.Query(p => p.Contrato.PessoaFisica.ID ==…
-
2
votes2
answers437
viewsA: Putting social media buttons on the site
Follow an example using Fonte Awesome and Bootstrap Social: <p> Exemplo 1: <a class="btn btn-social-icon btn-twitter"><span class="fa fa-twitter"></span></a> <a…
-
2
votes3
answers525
viewsQ: How to insert an existing record into the Entity Framework?
At some point in the system some records are selected and should be replicated by changing only one value. At this point I am selecting the records I need to enter: listaRegistros = listaRegistros…
-
1
votes3
answers52
viewsA: I did a project using the VS2015 SPA template. I want to take the start login page
Alter your RouteConfig.cs, it stays in the directory App_Start. Example: public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) {…
-
2
votes2
answers71
viewsA: Shortcut navigation between keys
Mathias' answer already answers your question. just stand with the cursor on the lock key and trigger the command Ctrl + [ Just to complement, here are some tips: If you want consult other shortcuts…
visual-studio-2015answered George Wurthmann 4,415 -
5
votes1
answer47
viewsA: How to have a result mixing checkbox'es?
Just do this: if(meuCheckBox3.Checked && meuCheckBox5.Checked) { //Combinação 1 } if (meuCheckBox1.Checked && meuCheckBox4.Checked) { //Combinação 2 } if (meuCheckBox1.Checked…
-
2
votes4
answers54
viewsA: Doubt about the use of the VS2015 SPA Template
See that you have all your form on View inside: @using (Html.BeginForm("Email", "Email", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { //Seu form } So you can do it in your…
-
1
votes2
answers5321
viewsA: Calling an asynchronous and synchronous method
I put the whole method but my doubt and about synchronicity of this method, the Notified method should be marked with async and usandoawait ? Whether to use it as asynchronous or synchronous to…
-
0
votes2
answers566
viewsA: Select with re occurrences of a period record
Can’t do what you’re asking using just a simple query using SELECT. You need to map all rules involved and use the PL/SQL to extract only the data you want. Below is an example with explanatory…
-
4
votes1
answer1530
viewsA: How to put a background image and make it responsive?
Use the BackgroundImageLayout thus: SeuObjeto.BackgroundImageLayout = ImageLayout.Stretch; You can also use the Zoom, if you prefer. Check more details on link.…
-
2
votes1
answer3406
viewsA: TNS-03505 - ORACLE tnsping
Have you checked the TNSNAMES? He gets in the way: [youDirectory] Oracle product 11.2.0 client_1 network admin tnsnames.ora The mistake TNS-03505 means that there has been a failure to resolve the…
-
7
votes2
answers1503
viewsQ: How to identify the MVC version?
How can I identify the MVC version I’m using in my project?
-
7
votes2
answers1503
viewsA: How to identify the MVC version?
With Your Open Project, Expand References. Right click on System.Web.Mvc. Click on Properties. Check the version on Version, as shown in the image below: Question added to Sopt as search source…
-
1
votes1
answer6191
viewsA: Sum of hour+minute oracle/sql
Run SQL below to see the solution with the same example of your question: WITH table_(data, tempo_duracao) as ( select '01/03/2017', to_date('01/03/2017 00:45', 'DD/MM/YYYY HH24:mi') from dual union…
-
16
votes3
answers3624
viewsQ: When to use asynchronous or synchronous method?
When to use asynchronous or synchronous methods in controllers (index, search, delete, create) of ASP.NET MVC applications? Can I lose performance? In which situations should I use one or the other,…
-
1
votes1
answer45
viewsA: Conversion of a Date to Character sub-query in Oracle
Just use the TO_CHAR passing the format you want. Example: SELECT TO_CHAR(DT_EMISSAO_NF, 'DD/MM/YYYY HH24:mi:ss') FROM DANFE ORDER BY DT_EMISSAO_NF DESC To use with Distinct make a sub select, like…
-
5
votes1
answer6800
viewsA: Entity Framework Connection String
Your connectionStrings should look like this on the web.config: To create in Localdb: <connectionStrings> <add name="DefaultConnection" connectionString="Data…
-
2
votes0
answers30
viewsQ: Can references affect performance?
In C#, for example, I can reference several namespaces: using System; using System.Collections.Generic; using System.Web.Security; using System.Web.UI; using System.Text; The very one Visual Studio,…
-
2
votes1
answer1739
viewsA: DLL Not found
Searching for the same problem, I was able to correct after a few attempts. First a few explanations: The bin folder receives the DLLs of your project after the Solution. If you give a Clean in the…
-
3
votes2
answers106
viewsQ: How to dynamically generate OR comparisons with LINQ?
I have a query where I should find certain values comparing whether a column is equal to a value X. X is an array that can have 1 to 4 values. How can I in mine query with LINQ dynamically assemble…
-
2
votes2
answers441
viewsA: How to select a date in c#?
The DateTime.Now returns to date and time and in your select you are asking to list only where the date is exactly the same as the one you returned on DateTime.Now. Change your select to (Using…
-
1
votes1
answer722
viewsA: How to add a link column in Gridview?
I found the solution: I needed to create a HyperLinkedField and not BoundField. After that, I just linked the created column with the field where I generated the links on DataSource. Follow the code…