Posts by pnet • 14,727 points
909 posts
-
2
votes1
answer1300
viewsQ: Calculate date difference and compare with integer field in lambda expression
I have a data field (Datetime) and also an integer field. I need to make the difference between this date field and today’s date (Datetime.Now) and compare whether it is larger or smaller than my…
-
1
votes2
answers147
viewsQ: Use lambda with Ado.Net
Using sqldatareader and ado.net, can you use lambda with Linq or just lambda or just Linq? This is not a multiple question, but Lynx and Lambda are always together, so the various "?" okay?
-
6
votes4
answers2718
viewsQ: Generate sequential Ids without losing the sequence
For Identity do not want, because it breaks the sequence if something happens. Max() + 1, I find it very vulnerable and slow when you have a lot of records. So I ask you, is there a way that someone…
-
1
votes1
answer368
viewsA: Error while consuming a web service Rest method
With debug there is no bug,. I discovered the problem. As I Gero my entities by Erwin, I made an entity with some string fields of such size. I had to change it and I did it for Erwin, for some…
-
0
votes1
answer368
viewsQ: Error while consuming a web service Rest method
I created a method where my partner, besides receiving data from our base, also sends us. Well, this was working well. Then I discovered that a field was missing. I added this field to the interface…
-
1
votes1
answer129
viewsQ: In the table Insert is inserting everything, until what I do not want
When I give a savechanges(), records to all tables and would like just one. How do I do? Tables Acao and ProximaAcao also inserts record. public T_TarefaParceiro geraIdParceiro() { WEBEntities db =…
-
2
votes1
answer55
viewsA: How to pass a string value to a type in the Entity
I killed with a colleague’s jewel. I did so: T_Acao t = new T_Acao(); t.acao = osParceiro.Acao; tarefa.T_Acao = t;
-
1
votes1
answer55
viewsQ: How to pass a string value to a type in the Entity
In my Entity mapping, the fields that are FK got like this: public virtual T_Acao T_Acao { get; set; } public virtual ICollection<T_OsParceiro> T_OsParceiro { get; set; } public virtual…
-
6
votes1
answer2820
viewsQ: Compares Datetime field in a lambda only part Date
In this lambda, result will almost always be null, because I gave a Getdate() straight at the bank and when this happens, I record Date and Time. How do I make this lambda pass only Data and compare…
-
7
votes4
answers2652
viewsQ: Do an update with lambda
I have a query in lambda that returns me a list of data. I wonder how I do to update this table of BD using lambda? Let’s say, I have a table called T_PDV and in it a flag field, where LIDO = 1 and…
-
4
votes2
answers1552
viewsQ: Clause in with lambda
Is it possible to have an IN clause with lambda Expression? Type: context.tabela.Where(a => a.meu_campo_id_tipo_inteiro....) let’s say one in like this: (2,3,4,5) As I put it in the dots?…
-
0
votes2
answers623
viewsA: Doubt on how to select a record via Inq
The way I solved it was. I did the Technical and Central pata scripts separately and then added to the object.
-
2
votes1
answer66
viewsQ: Expression inside a lambda gives error
I created a lambda and tried to create an expression or other. With or(||) it didn’t work. Then, instead of || I added Where. Is that right? This way now: var resultado = db.T_CRM_StatusPDV .Where(a…
-
6
votes1
answer13850
viewsQ: Join with three or more lambda tables
I made this expression using Lambda and 2 tables. var resultado = db.T_TarefaParceiro.Join( db.T_OsParceiro, t1 => t1.IDTarefaParceiro, t2 => t2.IDTarefaParceiro, (t1, t2) => new { t1, t2…
-
0
votes3
answers601
viewsA: Remove: from xml generated by my web service
I resolved so: Bodystyle = Webmessagebodystyle.Bare Before it was like this: Bodystyle = Webmessagebodystyle.Wrapped
-
0
votes2
answers608
viewsQ: Value when null does not show the value in xml
I did that: if (lis.DT_TransacaoV == null) pdv.Transacao = "Não Recebido"; else pdv.Transacao = "Recebido"; I have in the object PDV a property called Transacao string type. If it is different from…
-
1
votes1
answer2070
viewsQ: Assign value to an object property by a list of objects
I have a list of objects: List. Well, this object has three properties, say, cnpj, acao and novaacao. I did a lick or lick and brought me all the results, let’s say two lines. I do a foreach on the…
-
1
votes1
answer70
viewsA: Connection name with Entity is out of standard
I need to understand these things well. It was solved. I have a Solution with several projects, being one of them, a Web Service. As I am currently working on the Web Service, it is as my main…
-
0
votes1
answer948
viewsQ: Return only filled fields in the web service
I made a REST with WCF. In a method it returns me an object. It turns out that I don’t fill in all the fields of that object and it shows them all in the reply xml. How do I show only the fields…
-
2
votes1
answer1104
viewsA: Join with lambda Expression only
Solved. A colleague passed me: var resultadoAcao = (db.T_Acao.Join( db.T_ProximaAcao, t1 => t1.IDAcao, t2 => t2.IDAcao, (t1, t2) => new { t1, t2}) .Where( a => a.t1.IDAcao == 7)…
-
1
votes1
answer1104
viewsQ: Join with lambda Expression only
With LINQ no problem. Now, how do I make a join with two or more tables? Below the attempt of the join that I couldn’t go through with. Two tables(T_Acao and T_ProximaAcao). Field in join is the…
-
1
votes1
answer70
viewsQ: Connection name with Entity is out of standard
Whenever I change the database, I need to delete edmx and recreate it, because the update from database is not updating. So far so good. What happens is that he has now created a connection with the…
-
4
votes1
answer70
viewsA: Name of columns in web service return xml
I resolved so: if (db.T_TarefaParceiro.Max(p => (int?)p.IDTarefaParceiro) != null)
-
3
votes1
answer70
viewsQ: Name of columns in web service return xml
That line gives me that mistake: if (db.T_TarefaParceiro.Max(p => p.IDTarefaParceiro) != null) The mistake The cast to value type 'System.Int32' failed because the materialized value is null.…
-
1
votes1
answer62
viewsQ: I can’t get into the comic book with Entity
This is my input code. Why is it wrong? What should I do? public int abreOsParceiro(string os, string cnpj, string dataAbertura, string dataVisita, string tecnico) { WEBEntities db = new…
-
3
votes3
answers3330
viewsQ: Grab ID immediately after insertion
Entity and LINQ usage. I would like to know how I get a generated ID right after entering a record, before anyone else can enter it as well, that is, ensure that that ID is the one generated by me.…
-
0
votes1
answer851
viewsQ: Updating edmx file is not working
Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including shows the table to be updated or the fields. It doesn’t make any mistakes, it acts as if…
-
2
votes3
answers601
viewsQ: Remove: from xml generated by my web service
When I use XML in a Rest web service, it appears like this: <getCnpjParceiroResponse xmlns="http://tempuri.org/"> <getCnpjParceiroResult…
-
0
votes1
answer110
viewsA: Web Service runs but when consuming method gives error
solved. The error was as follows: When I uploaded the files to IIS that is on a remote machine on Amazon, I also uploaded my web.config. The database I’m using is on the same machine. Talking to the…
-
-1
votes1
answer110
viewsQ: Web Service runs but when consuming method gives error
I struggled to set up my web service on IIS. It goes up, showing the screen that WS is ok. It turns out that when I pass a parameter to it gives this error: REQUEST ERROR The server encountered an…
-
1
votes1
answer221
viewsQ: Error posting my Webservice
When I run my Webservice and publish on IIS(7) the following error occurs: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base…
-
0
votes2
answers623
viewsQ: Doubt on how to select a record via Inq
I have a chart, where I only record scripts. There is a field, where I separate whether it is technical script or central script. There is a field TipoScript char e is "C" or "T". This table was not…
-
0
votes1
answer110
viewsQ: When I run my WCF REST enters the WCF Client Test screen
When I run my WCF REST enters the screen of WCF Client Test. Before it was working. Because this is happening, IE, because enters the screen WCF Client Test?
-
1
votes1
answer181
viewsQ: Problems with radiobutton in table(TR for each one) - Accepts that all are clicked
I have this table and these radios Buttons. I happen to select more than one radiobutton, it does not obey the question, from one selected the other does not. <table> <tr>…
asp.net-mvc-5asked pnet 14,727 -
1
votes1
answer873
viewsQ: Change font size using @Html.Label
How do I assign a font size and colors using @Html.Label? I know if I use htmlAttributes I can use: @class = ... i get via css. But I wish I could do it without using CSS. It’s like?…
-
1
votes2
answers290
viewsQ: How to create a checkbox name created with mvc helper
How I use the mvc helper to create a chekbox and with its name attached to the checkbox. And if there’s any way I can put the name of the checkbox on the left or right. I did so and it didn’t work:…
asp.net-mvc-5asked pnet 14,727 -
1
votes2
answers81
viewsQ: Doubt with mvc helpers
I have this include in my view(cshtml) @model List<SuporteTecnico.Models.T_PDV> Now I need to create a table, and in a TD I put the label and in another the Textbox. I did so: <tr>…
asp.net-mvc-5asked pnet 14,727 -
1
votes2
answers529
viewsQ: I rotate in my browser Webservice and gives me a strange message
While giving a View In Browser on my Webservice, brought me this message. It doesn’t look like a message that Webservice is all ok. What is this message? Service This is a Windows© Communication…
-
2
votes1
answer297
viewsQ: Error in view when using Displayfor and foreach
I made this html inside my cshtml. I went to do a foreach and it was an error in foreach and also did not recognize modelItem. In the Models folder are my edmx, so T_PDV is a BD entity mapped in…
asp.net-mvc-5asked pnet 14,727 -
0
votes1
answer139
viewsA: Interface does not recognize class type even with declared DLL
The following. I was with a svc within my main project. I created a new WCF Service Application project separately. I created and he created a project separately, getting my Solution with 5…
-
0
votes1
answer139
viewsQ: Interface does not recognize class type even with declared DLL
I created a Class Library project and in it a POCO class. I created an Interface (all following John Sharp’s book). Then I created my WS with WCF. Well, in the interface I declared a method of my…
-
1
votes1
answer332
viewsA: Attribute not recognized, but Namespace is added
I have 4 projects in my Solution. I added the dll from Serialization, but I didn’t add in the project in question. I didn’t understand why I didn’t error using without the DLL. But I added it and it…
-
-1
votes1
answer332
viewsQ: Attribute not recognized, but Namespace is added
My attribute [DataContract] is not being recognized, but the namespace System.Runtime.Serialization is added in my using. Does anyone know why? .... using System.Runtime.Serialization; using…
-
-1
votes1
answer106
viewsQ: Doubt in the construction of WS REST(Contract)
Gentlemen, I took an example in the book of john Sharp(microsoft press) to build a REST and came a simple doubt, but a doubt of good practices. He uses the Northwind BD. He creates a Class Library…
-
1
votes1
answer145
viewsQ: Feed Hidden field by clicking on a table column
This is my jQuery that builds HTML into my cshtml. $(data.resultado).each(function () { str += '<tbody>'; str += '<tr>'; str += '<td>'; str += '<label…
-
2
votes2
answers651
viewsQ: Use or not use table
I need to position controls Abels, exactly one below the other and sometimes beside. I do this with table, but ask. Is there another way to do this and give a result similar to table? Table is…
-
6
votes3
answers4918
viewsQ: Create table html and zebrar the same
I wonder, how do I zebrar an HTML table? It has only two columns and information is populated dynamically from the controller and BD.
-
27
votes4
answers9073
viewsQ: What is the difference between using . js and .min.js files?
When should I use a Javascript or jQuery file, with file min and jspure, like: <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script…
-
1
votes1
answer228
viewsQ: How to avoid page being displayed in another tab
I have this jquery $(window.document.location).attr('href', '/gerenciarpdv'); And that button calls that page <button id="teste1" name="teste" class="btn-pesquisa"…
-
0
votes3
answers238
viewsQ: Footer does not position at the bottom of the page
My css: #rodape { position:absolute; bottom: 0; } .RodapeFaleConosco { float:right; } .RodapeTermoPolitica { float: left; } Now my code in jquery to load html str += '<div id="rodape">'; str…