Posts by Tiedt Tech • 2,427 points
88 posts
-
3
votes1
answer1099
viewsQ: Get Data from Webservice in C#Action
I have an application that accesses third-party Webservice. To improve the testing process, I am setting up a website to simulate Webservice. This site consists of several Actions, which return XML,…
-
1
votes0
answers211
viewsQ: C# service installer with custom actions
I’m doing a service in C#, and I want to create an installer. I followed some tutorials, and found the setup of Visual Studio kind of basic. Any suggestions on how to make a beautiful installer with…
-
3
votes2
answers2925
viewsA: Consultation in table with self-relationship
Look if this is what you need: SELECT c.*, p.categoria AS catpai FROM categoria AS c left join categoria AS p on p.pai = c.idcategoria;
-
1
votes4
answers1989
viewsA: Updating data with Entity framework
I’ll do it like this, see if it helps you. [Authorize] [HttpPost] [ControleDeAcesso(TipoAcao.Normal)] public ActionResult Detalhar(string btnSubmit, Memo model) { // Verifica se o modelo é válido,…
-
4
votes2
answers844
viewsA: CONSTRAINT that adds parameter to FOREIGN KEY?
As I do not know the structure of your application and do not know the database permissions and who will have access, to do what you need I would do so: Function for the Constraint CREATE FUNCTION…
-
2
votes2
answers1393
viewsA: Alternative to Session
I also use Session in my application to maintain user access data. I consider it faster than searching the direct database. Question 1 Regarding the loss of Session, I believe that you should set…
-
6
votes4
answers5242
viewsA: What is the priority of HTML? "id" or "class"?
The selector id has greater precedence than the selector class. So when you have both, the id will always be applied. .foo { color: blue } #intro, #intro1 { color: red } <p…
-
1
votes1
answer460
viewsQ: Check C#threads
I am trying to understand the code below, but without success. From what I’ve researched, GetMaxThreads returns maximum available threads and GetAvailableThreads what is available. In the case of…
-
4
votes1
answer1518
viewsQ: SQL Server Performance Loss with Sequential Insert
I have an . Net C# application that takes data via Web Service and saves it in an SQL Server 2012 database. Initial performance is 20 records per second. After having some 10000 records in the…
-
1
votes1
answer1005
viewsQ: Error saving list of MVC C#objects
As the post Edit object list with POST form in MVC C# I was able to make my application display the values. However, trying to save the data gives the error: The operation failed: The relationship…
-
1
votes1
answer1321
viewsQ: Edit object list with POST form in MVC C#
I have the two classes below. I know how to make a screen to enter the data, and take the data from PERSON and PHONE, by model and for List. But how to do this on an edit screen? I want to show the…
-
2
votes1
answer3790
viewsQ: Getting objects with Jquery and sending via Ajax to MVC C#
I’m trying to understand how to receive HTML objects for a MVC C#controller. I know the code below works if the controller has string[] teste. <input type="hidden" name="teste"> <input…
-
4
votes2
answers1514
viewsQ: View Razor to PDF
I need to convert Views of my MVC 5 application to C# using Razor to PDF. I already searched, and the free tools depend on iTextSharp, which I searched for has a different marking. But I need to…
-
6
votes3
answers1909
viewsA: Try/catch does not show correct message
I found the problem/solution. As the project is composed of several DLL’s, calling one of these DLL’s, the error presented by eg. Message is from the source process, so it shows the message "Message…
-
3
votes3
answers1909
viewsQ: Try/catch does not show correct message
Guys, I have a C# code that has the code: Uri resultadoURL; bool resultado = Uri.TryCreate(Configuracoes.Configuracao.URL, UriKind.Absolute, out resultadoURL) && resultadoURL.Scheme ==…
-
0
votes2
answers1059
viewsA: For database abstraction, should I use uppercase or lowercase column names?
Everything depends on the taste of the team and whether there is already a standard in the company. As there is no 100% standard I will give the tips of the rules I follow, after a few years…
-
2
votes4
answers2652
viewsA: Do an update with lambda
I made a complete example of a Detail controller that updates any record. When entering the registry, I check if everything is ok. Then I take the PK (Primary Key) from the registry and search it…
-
0
votes1
answer173
viewsQ: jScrollPane with jQuery Sortable from 2 lists
I’m riding a layout where I have two lists (first with 3 maximum items and the second with other items), I can move items between the lists using the sortable jQuery. The function works perfectly,…
-
6
votes3
answers1328
viewsQ: Returns Json of object in C# with Entity Framework
I’m having a problem returning a Json using Entity Framework. The code I’m using is: [AcceptVerbs(HttpVerbs.Get)] public JsonResult Item(int agendaHorarioID) { using (var db = new ERPContext()) {…
-
5
votes1
answer5097
viewsA: How to group by month with SQL?
Here is the solution: I posted it on http://sqlfiddle.com/#! 15/a04f8/8, simulating with Postgresql 9.3.1, but I believe it works with all databases, with Oracle, SQL Server and Postgresql will…
-
-1
votes2
answers81
viewsA: Doubt with mvc helpers
I think it works: @foreach (var item in @Model) { <tr> <td>@Html.Label("Razão Social")</td> <td>@Html.TextBox(Model.RazaoSocial)</td> </tr> }…
asp.net-mvc-5answered Tiedt Tech 2,427 -
4
votes3
answers22703
viewsA: When is the use of composite primary key recommended?
Answering the initial question of whether or not to use composite PK. From experience I’ve learned taking a beating that it’s not good to use composite key. We can cite as an example to use single…
-
3
votes1
answer1281
viewsA: Good Practice when modularizing an application with EF and multi-bank
I currently use EF in my Windows Forms and Web applications. To use multiple databases, the only differentiation is the connection string. But I already warn that to make work some Sgdbs will have a…
-
2
votes1
answer537
viewsQ: Ajax request in C# update authentication
as I do for each Ajax request, update the Forms Authentication cookie. I want to update on Forms Authentication in my controller, because it is a calendar screen that uses Fullcalendar. I’m having…
-
3
votes2
answers13442
viewsQ: Add image in shared link on Facebook
when trying to share a link from my blog on Facebook, Facebook can pick up the text of the article, but it does not load the images to put in thumbnail. Someone would have an idea what I should do.…
facebookasked Tiedt Tech 2,427 -
1
votes1
answer854
viewsA: Recognize File . INI / Redo File . INI in case of file deletion
I made it here this way and it worked: var arquivo : TIniFile; existeArquivo : BOOL; begin if not DirectoryExists('C:\sga') then begin if not CreateDir('C:\sga') then begin ShowMessage('Erro ao…
delphianswered Tiedt Tech 2,427 -
1
votes2
answers558
viewsA: Group plots showing the value of the first and last plot
Here is my solution: Structure: create table PARCELA ( inscricao int not null, nrparcela int not null, dt_vencimento datetime, vlrparcela decimal(15,2) ); alter table PARCELA add constraint…
postgresqlanswered Tiedt Tech 2,427 -
1
votes4
answers2258
viewsA: Conditional Data Annotation MVC4
My solution: [AttributeUsageAttribute(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] public class DataAposentadoria : ValidationAttribute {…
-
-1
votes1
answer846
viewsQ: "Invalid App Id" error on "Like" Facebook button
I’m doing a blog and I’m putting the button like. The code I’m using is: This is at the top of the page: <script> (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if…
-
2
votes2
answers771
viewsA: Bring three possible results with Lambda
I think it works: .Where(w => w.DataTransacao == (w.DataTransacao.AddDays(45) >= new DateTime(2014, 5, 5) ? 3 : w.DataTransacao.AddDays(15) <= new DateTime(2014, 5, 5) ? 1 : 2 )) Just…
-
4
votes1
answer2652
viewsQ: Web Api Client in Windows Forms
I am making a client using Web Api. My site has the server function of the Web Api. I found this reference from Microsoft…
-
2
votes5
answers2481
viewsA: Do not allow saving duplicate records
You can do it many ways. The solution of @andervoc, in the model is perfect. I would only add this command in the database, with this you would be more secure: ALTER TABLE TABELA ADD CONSTRAINT…
-
0
votes3
answers3813
viewsQ: Reports in C# MVC
How do I report to c# Asp.net-mvc-4? I use a third-party component or make an HTML page myself? What you use in everyday life? I ask, because I need to print reports that follow a government…
-
2
votes5
answers363
viewsA: What does ? and : within an expression?
Simple, this is nothing more than if and Else in a fast way When parseFloat(field1) > parseFloat(field2), if true, the variable takes field1, otherwise it will be field2. There is still x ?? y,…
-
3
votes4
answers1320
viewsQ: Long processes in C#
I need to do a routine where the user will upload a data load file, and C# will process it and save it in the database, without giving time-out and showing the process progress to the user. My…
-
0
votes6
answers708
viewsA: How to count the number of clients that returned from one year to the next through SQL?
Here’s my contribution. I took tests and it worked. create table ORDEMSERVICO ( CDCLIENTE int, AUXORDEMSERVICO varchar(3) ); insert into ORDEMSERVICO values (12, '/12'); insert into ORDEMSERVICO…
-
1
votes1
answer928
viewsA: How to check if my one-column record (FK) is present in other tables?
What you want to do is interesting but it would cost the database more than you trying to delete the record directly. I’ll show you why. First you have to base yourself on this select: SELECT…
-
10
votes3
answers5558
viewsQ: Master-detail in MVC C# with Razor
Guys I need to set up a master-detail record. I have already researched and seen some examples on the internet, but as I do for when the master is not registered, the details are stored temporarily…