Posts by Edney Batista da Silva • 549 points
26 posts
-
0
votes1
answer128
viewsA: Xamarin.Forms - Shared Project x PCL
Shared projects have a very similar concept to shared files and folders. Both projects, Android, IOS and Winphone, will have access to the same folders and files, and any changes made to one of the…
-
0
votes1
answer72
viewsA: How to approve a model depending on another model confirmation?
By saving your request you can redirect the user to the screen with the lists of all requests: [HttpPost] public ActionResult Create(Solicitacao solicitacao) {…
-
2
votes3
answers847
viewsA: How to create Login and User in SQL Server passing command line through Visual Studio passing parameters?
As far as I could understand, sql does not accept the login name as a parameter. To solve this without giving up the use of Parameters, you can use dynamic Sql execution. For this change your code…
-
1
votes2
answers276
viewsA: Dropdownlist with Begincollectionitem
Hello, change your code as follows: @Html.ListBox("Id", new SelectList((List<SeuNamespace.Lixo>)ViewBag.Lixo)) I hope I’ve helped.
-
2
votes2
answers72
viewsA: How to use an Array to draw elements?
Hello made an example in C#, you can adapt it to VB: TextBox[] array = new TextBox[10]; array[0] = textBox1; array[1] = textBox2; array[2] = textBox3; array[3] = textBox4; array[4] = textBox5;…
-
1
votes1
answer782
viewsA: Read and insert data into a table via C#
You can resolve by changing your SQL by leaving your code as follows: conn.Open(); comm.CommandText = @" IF(NOT EXISTS(SELECT 1 FROM ArticleBarCode WHERE Code = @code1)) BEGIN INSERT INTO…
-
0
votes1
answer113
viewsA: Set comma in a return Json
Hello. Use the package newtonsoft json. It allows you to work with greater ease to convert jsons to . net objects and vice versa. Here you can learn more how to use this library. I hope I’ve helped.…
c#answered Edney Batista da Silva 549 -
3
votes2
answers1184
viewsA: How to read a user-submitted txt file?
Hello, by posting this reply I am assuming that you are using ASP.NET MVC Core. I created an extremely simple solution just so you can absorb some basic concepts. First let’s create the Models…
asp.net-mvcanswered Edney Batista da Silva 549 -
1
votes1
answer103
viewsA: ASP.NET MVC How to Manipulate Table Users Using Code First
Hello, I believe the article ASP.NET Identity - Customizing User Registration on Eduardo Píres' blog, can I help you. I hope to have helped.…
-
1
votes3
answers123
viewsA: Contains within a list
Hello, try the following: retorno.Where(w => w.Acessorios.Any(a => idAcessoriosSelect.Contains(a.ID_ACESSORIO) ).ToList(); I hope I’ve helped.
-
2
votes1
answer336
viewsA: Implementation of Abstract Factory, Factory Method and Adapter standards
Hello, I am not an expert in php, but I could understand your question well. My first observation is about you using the Abstract Factory, I don’t really see you employing the same, because as you…
-
1
votes1
answer835
viewsA: Upload images to Asp net core 1.0
Hello, try the following: // Na sua controller adicione o using using Microsoft.AspNetCore.Http; // E altere sua action para [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(Cliente…
-
4
votes1
answer828
viewsA: How to change the app.config file at runtime?
Hello, try this on: var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var connectionStringsSection =…
c#answered Edney Batista da Silva 549 -
4
votes3
answers713
viewsA: foreach is a loop or iterator? Or can it be both?
Hello, I found this discussion a little bit interesting, and just to complement what @Brunocosta and @Maniero said, note that the following code below also works normally: IEnumerable<string>…
-
0
votes1
answer451
viewsA: How to change a Button’s Text property inside a for
I recommend using Peater instead of explicit: <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:Repeater runat="server" ID="rpBotoes"…
-
1
votes1
answer589
viewsA: Send form parameter to controller via ajax
Hello, start by changing the type of input that triggers the event, try this: First create the following javascript function: function onClickBotaoFiltrar() { var ItemContratoId =…
-
1
votes2
answers120
viewsA: Sum of values taking into account 3 table fields
Hello, try this on: SELECT part_id, alternative, revision, totals FROM ( SELECT tb1.part_id, tb1.alternative, tb1.revision, tb1.totals, ROW_NUMBER() OVER (PARTITION BY tb1.part_id ORDER BY…
-
0
votes1
answer96
viewsA: Web api 2 within MVC project. How to prevent redirection to login page when token is not valid
Hello, try using Result to return to your desired status. public class WebApiAuthorizeAttribute : System.Web.Mvc.AuthorizeAttribute { protected override void…
-
0
votes1
answer295
viewsA: Problems with Scriptmanager.Registerclientscriptblock
Hello, your problem is not in the instructions: Response.Flush(); Response.Clear(); Response.ClearContent(); HttpContext.Current.ApplicationInstance.CompleteRequest(); EscreveErroNaTela(); What is…
-
1
votes3
answers626
viewsA: How to use Lambda expression in List<List<Object>?
Hello, try the following: lstListItNota.SelectMany(lista => lista).Where(item => item.Codigo == "A")).ToList(); select Many returns a collection of collections, i.e., you have a list of…
c#answered Edney Batista da Silva 549 -
0
votes2
answers275
viewsA: How to know which button called the page?
Hello, if I understand correctly, you are redirecting from one page to another after pressing any of the buttons, correct? Then try the following: // Na página com seus botões protected void…
-
1
votes1
answer877
viewsA: Show an image in mvc
Hello, in your code change the following section: mapper.Imagem = pathSave; for: mapper.Imagem = pathBase; What you are basically doing is saving the physical path of your image, not the url to…
-
0
votes1
answer330
viewsA: Add column to a table (foreign key) using Entity framework
The image field in the Users table can accept null values? I’m not quite sure how you structured your classes, but by the message presented, when trying to include the column, as there are already…
-
1
votes1
answer73
viewsA: Hide form using F1 key C#
Hello, try the following: private bool IsHide { get; set; } /*O Evento gkh_KeyUp pode ser removido, eu apenas comentei void gkh_KeyUp(object sender, KeyEventArgs e) { this.Show(); e.Handled = true;…
-
0
votes2
answers730
viewsA: How do I checkbox Asp.net mvc database
Posting lists of objects usually takes a little work. In these cases I usually use Custom Model Binders. By default Asp.NET binds the data of our Views to the parameters in our Actions, so when we…
-
0
votes2
answers150
viewsA: Validation when editing existing registration?
Thinking of a more elegant code I would recommend you to use the concept Tell Don’t Ask Ta, but what does that help your problem? By improving the designe you can return the error encapsulating your…