Posts by Pablo Tondolo de Vargas • 5,444 points
213 posts
-
0
votes2
answers462
viewsA: Copy excel extension files from various subdirectories with ssis
Ednilton, the Directory.GetFiles returns the filenames (including paths) in the specified directory. To list all the files, including those of subdirectories, you need to pass more the SearchOption.…
-
3
votes1
answer54
viewsA: Is it mandatory to rebuild?
Check in the menu Build | Configuration Manager if the Active solution.. is as debug and if all projects are marked as build
-
4
votes1
answer75
viewsQ: Storyboard Segue
I’m creating a small example of an iOS app using Visual Studio 2015 on Windows 10. But every time I open the Main.storyboard by the designer and I click on one of the UIStoryboarSegue the property…
-
1
votes2
answers1383
viewsA: Pick up a selected item on Dropdownlistfor using an ASP.NET MVC Viewmodel
Iago, I believe you only need to repopulate the categories in the post again. // POST: SubCategorias/Create [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(SubCategoriaViewModel…
-
1
votes1
answer352
viewsA: How to pass parameter to Index from another Controller
In your situation, just add one more parameter to your ActionLink which would refer to htmlAttributes @Html.ActionLink("Detalhes", "Index", "RelatorioRa", new { tagId = item.TagID }, null) If you…
-
2
votes2
answers1081
viewsA: List table with condition ASP.NET MVC
Well, as I said, what you need is basically what @Gypsy has answered here /a/102945/5846. An example I created for your case is the following. You will need a ViewModel for your research public…
-
1
votes1
answer657
viewsA: Save files from a Datagridview
You can work with the objects of interoperability of the Office Here is an example of a function that exports data from a DataGridView private void ExportToExcel() { // Creating a Excel object.…
-
0
votes1
answer345
viewsA: Asp.Net Mvc Remote Validation
The solution was in Action Create return an instance of the model public ActionResult Create() { return View(new TesteRemoteViewModel()); } And in the method called by RemoteAttribute disable the…
-
1
votes3
answers684
viewsA: How to correctly scroll through all items in a checkedListBox C#?
You can first use the method CheckedItems which will return whether or not there are selected items. If the Count be zero, you show the message, otherwise you make the tab change private void…
c#answered Pablo Tondolo de Vargas 5,444 -
3
votes2
answers2603
viewsA: How does an anonymous guy get back?
I believe it is not possible for you to return an anonymous type. You may not declare that a field, property, event or return type of a method has an anonymous type. Likewise, no can declare that a…
-
5
votes1
answer49
viewsA: error with EF and Mysql query
Linq does not support the method ToDateTime What you can do is create a variable and then use it in your query var data1 = Convert.ToDateTime("2017/01/01"); var data2 =…
-
-3
votes2
answers790
viewsA: Inputbox lock CTRL+V
is simple, in the event KeyPress of your input, you put the following code if (Key=#22) or (Key=#3) then Key:=#0; // 22 = [Ctrl+V] / 3 = [Ctrl+C]…
-
8
votes5
answers991
viewsA: What is UX (User Experience)?
User experience User Experience (EU), English user Experience (UX), involves the feelings of a person in relation to the use of a particular product, system or service. User experience highlights…
-
7
votes1
answer430
viewsQ: Using synchronous methods together with asynchrons
For development reasons, I needed to create a call to an asynchronous method in a synchronous method, but when publishing my project on the server, it is indefinitely running. Asynchronous method…
-
2
votes2
answers78
viewsA: Failed to make a database change
Your CODIGOMODELO is a integer in the bank and in your update you are not doing the IIF ' CODIGOMODELO = ' +iif(cdsImpressoraCODIGOMODELO.AsString='','0',cdsImpressoraCODIGOMODELO.AsString)+','+…
-
2
votes1
answer111
viewsA: Error saving data from a Radiogroup
I see you have a column DESCRICAO right on top of the status, she also needs the QuotedStr Thus remaining var update: string; begin update = ' UPDATE Suprimento ' + ' SET SUPRIMENTO = ' +…
-
2
votes1
answer63
viewsA: Failure to enter data in the database by Radiogroup
Missing you add simple quotes. Try to use the function QuotedStr to add the simple quotes, being as follows QuotedStr(cdsEmpresastatus.AsString)…
-
5
votes2
answers1153
viewsA: Left Join with multiple fields from the same table
What you need is something like, for every relationship of contrato with your table pessoa, you add a left join select C.ID_CONTRATO, PT.NOME AS TITULAR, PR.NOME AS RESPONSAVEL, PN.NOME AS NOTA from…
-
3
votes1
answer78
viewsA: How to make Selectlistitem substring?
A quick solution to your case could be as follows var resultado = (from p in db.Tabela where p.Campo == 1 select new Projeto.Models.Model { Id = p.Id, Description = p.descricao.Substring(0, 30)…
-
0
votes2
answers524
viewsA: How to remove the decimal separator from a result?
You can make a convert for int, see how it looks declare @valor_total decimal(18,2) = 195.41 select convert(int, @valor_total*1000)
-
2
votes1
answer54
viewsA: Displayname does not work in relationship
What happens is that you are specifying the parameter labelText, then what’s in the DisplayName will not be shown. Alter your LabelFor for @Html.LabelFor(model => model.EquipeId, htmlAttributes:…
-
1
votes2
answers512
viewsA: Sort Datetime field only by Date part
An alternative would be for you to give one ToList before ordering, thus staying var query = contexto.Contas.ToList().OrderBy(c => c.Data.Date).ThenBy(c => c.Codigo);…
-
1
votes2
answers78
viewsA: Convert SQL to LINQ C#
Another way would be var resultado = (from a in contexto.ACOMPANHAMENTOes from pa in contexto.PRESO_ACOMPANHAMENTO from p in contexto.PRESOS where p.ID_Preso == 300 && pa.ID_Preso ==…
-
1
votes2
answers509
viewsA: Capture values from one table and insert them into another
You can use the SQL INSERT INTO SELECT The function of which is to copy the data from one existing table to another. Example without the declaration of the columns to be inserted, which can be used…
-
0
votes2
answers101
viewsA: EF relationship
Well, first I’ll show you a little bit of how I usually do in my projects when I have the question of Status in certain functionalities. To carry out the mapping in my projects, I define a history…
-
1
votes1
answer156
viewsA: How to send Partialview input to a controller?
The solution to your problem is to specify in your Form the action, being as follows @using (Html.BeginForm("TuaAction", "TeuController")) But because you use Typed View, you can change your…
-
0
votes1
answer345
viewsA: Chosen ASP.NET MVC plugin
The solution was to add the following java script code $('select').on('change', function () { $(this).valid(); });
-
1
votes1
answer412
viewsA: Extract icon from an application
I believe that eventually some processes did not allow to extract the icon from them. What I did was add one try catch to continue execution in the event of a failure. Remembering that you will have…
c#answered Pablo Tondolo de Vargas 5,444 -
3
votes1
answer116
viewsA: Sort 2 columns at a time - Asp Mvc + Fluentnhibernate
What you should use is the function ThenBy as in the example MyList .OrderByDescending(p => p.ToDate) .ThenByDescending(p => p.Number) .ThenByDescending(p => p.RunDate) .FirstOrDefault();…
-
11
votes3
answers2766
viewsQ: Count or Count()
Having a list, what better way to know the number of items on this list and what the difference? if (minhaLista.Count > 0) ; or if (minhaLista.Count() > 0) ;…
-
1
votes1
answer57
viewsA: How to create command line update fields from the board
First, it is not advisable to concatenate sql statements as you did. cmd.CommandText = "Update carros set placa='" + campoplaca.Text + "', marca='" + campomarca.Text + "' where placa='" +…
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes3
answers3825
viewsA: Limit for sending files
In the httpRuntime within your web.config you can specify the maxRequestLength which will determine the maximum size of your requests. The maximum size of requests, in kilobytes. The default size is…
-
2
votes1
answer190
viewsA: Problem saving Dropdownlist information to the database
What you need to do is assign the values of your DropDownList for their respective properties Imovel a = new Imovel(); a.IdCidade = Convert.ToInt32(ddlCidade.SelectedItem.Value); a.IdLocal =…
-
2
votes2
answers62
viewsA: Save Campo Automatico
From what I understand you want to keep the State Id fixed in your application. Come to think of it, enough in your method Create fill in the EstadoId with the desired value. [HttpPost]…
asp.net-mvcanswered Pablo Tondolo de Vargas 5,444 -
2
votes1
answer124
viewsA: Send array to controller via Ajax.Beginform and update Partialview
So that your inputs of status can be sent via Get form, you should name them as your possible on Array. name="status[0]" id="status[0]"…
-
0
votes1
answer255
viewsA: Add the same column by different criteria?
Try to use the instruction if SUM(IF(e.tipoOperacao = 'E', e.qtdTransacao, 0)) AS QTDENTRADA
-
6
votes2
answers1594
viewsA: XML serialization - NFC-e ide element
Analyzing your code, I believe the problem is time to instantiate the infNFe.det Because before adding elements to Arrya you must instantiate it by stating its size What have you done…
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes1
answer79
viewsA: How to count how many instances of a program are running from a shared folder?
@Wouldn’t Leandro be the case if you open Access in exclusive mode? If you are using OLE DB, adjust your Connection String adding Mode=12; Getting something like…
-
3
votes2
answers85
viewsA: Modeling of Models 1 to n
@dorathoto seeing his idea of having an entity Horario, with beginning and end I believe that its main problem is that the Modalidade who has a ICollection of schedules and not unlike how you…
-
1
votes3
answers3965
viewsA: Check the existence of Dice?
What I usually do is a select in sys.objects if (not exists (select null from sys.objects where name = 'meu_indice')) the complete script gets if (not exists (select null from sys.objects where name…
-
2
votes0
answers27
viewsQ: Solutiondir in T4 Template
I’m trying to carry a Assembly in the template T4, but when trying to use the $(SolutionDir) my Assembly does not load, only works if I put the whole way. That’s how it works <#@ assembly…
-
2
votes2
answers82
viewsA: C# conversion of a private void to public void
When changing the visibility and method name, you should keep the parameters as well. Being as follows public void Detect(object sender, KeyPressEventArgs e)
c#answered Pablo Tondolo de Vargas 5,444 -
1
votes1
answer639
viewsA: How to take the path of the directory
Caio, what you seek is class Fileinfo, can be used as follows FileInfo fileInfo = new FileInfo(SFD.FileName); System.IO.File.WriteAllLines(fileInfo.DirectoryName, SaveString); In that case the…
-
5
votes3
answers1696
viewsA: How to transpose rows into columns?
A slightly more elegant form than was presented, would be to use unpivot, select * from Tabela unpivot ( Valor for Ano in ([Jan], [Fev], [Mar], [Abr], [Mai], [Jun], [Jul], [Dez]) unpiv order by ano…
-
4
votes2
answers3166
viewsA: How to get the current path of a . sh script?
Using the command line in Linux, it is possible to use the pwd shell command to get the path(path) of the target directory. However, when this command is executed inside a directory that is a…
-
2
votes2
answers4207
viewsA: Capture file name
You can use the class Fileinfo, in it you will find several methods to work with files FileInfo fileInfo = new FileInfo(dbfile); //Mostra o nome do arquivo string fileName = fileInfo.Name; //Mostra…
-
1
votes2
answers963
viewsA: Images do not appear on the website posted on the web server
change to <img src="@Url.Content("~/imagens/logo.png")" /> From you are using a virtual directory inside the main site on IIS and the way it was ~/ it will search the IIS Root folder…
-
2
votes3
answers510
viewsA: Take class property C#
An alternative for you would be to have your classes implement an interface, for example IMinhaClasse. Thus remaining: public class MinhaClasse1 : IMinhaClasse { } public class MinhaClasse2 :…
-
1
votes3
answers2379
viewsA: Set minimum number of characters in Textbox
It’s very simple if you’re using the asp:TextBox just use a asp:RegularExpressionValidator, being as follows <asp:TextBox runat="server" ID="TextBox1" MaxLength="100"></asp:TextBox>…
-
1
votes1
answer100
viewsA: Textboxfor returned Null Post
What I imagine happened in your case. From the 2015 version of Visual Studio when using intellisense to generate a property in the ViewModel, VS is generating as internal set, I have already looked…