Posts by Ismael • 4,781 points
138 posts
-
4
votes4
answers7923
viewsA: How do I give Enter and Run my SEARCH button
Mode 1 You can use the event KeyDown. Instead of using the key code, make use of the enumeration of keys. private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter)…
-
1
votes2
answers253
viewsA: How to store multiple user names in one variable?
The way your code is, it will not return the database records, only the total of records affected (ExecuteScalar). To return the records, and then scroll through them, you will need to use the…
-
7
votes2
answers43536
viewsA: Error doing Insert - String or Binary data > would be truncated
The problem is actually in the field RX_NUM. On the table t_cmo_planilha_leitura he’s the type varchar(255) And on the table t_cmo_oit1980_leitura he’s the type varchar(6) That is, they are of…
-
6
votes1
answer763
viewsA: Insert with two different selects
Lacked transform their sub-select in a select valid for the clause Values: insert into t_cmo_oit1980 (id_oit, id_exm_rea) select (select max(id_oit) + 1 from t_cmo_oit1980), (select id_exm_rea from…
-
1
votes1
answer1553
viewsA: Popular table in sql server with data coming from an excel spreadsheet
You can make a select directly in your spreadsheet: (You will need to run the initial settings with the sp_configure) sp_configure 'show advanced options', 1 reconfigure exec sp_configure 'Ad Hoc…
-
2
votes2
answers121
viewsA: Error compiling project with VB 6. Pass to . Net
Download the controls: MSMask.MaskEdBox -> MSMASK32.OCX MSComCtl2.DTPicker -> MSCOMCT2.OCX After downloading, register these controls: Open command prompt as administrator; Navigate to the…
-
1
votes2
answers427
viewsA: How can I detect if the value of a textbox has letters?
A very simple solution - Winforms private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar !=…
-
1
votes3
answers106
viewsA: Filter per parameter or all
First, in your SQL query you should do so: WHERE LE.ID_LEAD = 0 OR ID_LEAD = @ID_LEAD On LINQ in the same way: //pId é seu parâmetro (não nulo) var lead = (from l in this.DB.BGC_LEAD where l.ID_LEAD…
-
2
votes2
answers386
viewsA: Get Boolean Value Gridview Column
Try this way (updated): CheckBox Insertar = (CheckBox)GridView1.SelectedRow.Cells[5].Controls[0]; if(Insertar.Checked == true) { //seu código } I assigned it directly to the police, but you can do…
-
2
votes1
answer48
viewsA: Only spend a year in a proc of sql server 2014
One solution for this filter is to convert it as whole: DECLARE @ANO_DT_DE_LAUDO INT DECLARE @ANO_DT_ATE_LAUDO INT SET @ANO_DT_DE_LAUDO = YEAR(@DT_DE_LAUDO) SET @ANO_DT_ATE_LAUDO =…
-
5
votes2
answers32603
viewsQ: How to get the size of each table in the database?
Through a query, how can I get the disk space that the tables (in a database) are occupying? I can list all tables using sys.tables, but, and the size? SELECT NAME AS NomeTabela FROM sys.tables…
-
4
votes1
answer39
viewsA: Device Id Access
That’s possible: import android.provider.Settings.Secure; private String android_id = Secure.getString(getContext().getContentResolver(), ANDROID_ID); Originally taken of this question.…
-
1
votes1
answer60
viewsA: Error Calling Up Report
You should change this your query and make sure that in these two columns do not consider the value zero. To avoid the: Division error by zero. I proposed two solutions: Solution 1 Just added to…
-
2
votes1
answer100
viewsA: Invalid Parameter when Initializing Process() running Git ssh in C#Console Application
When using the ProcessStartInfo, you must pass the parameters in the property Arguments, all necessary. In your case, it will stay that way: string pathGit = "\"C:\\Program Files…
-
1
votes1
answer33
viewsA: Sqldatareader Incompatible Databindtable does not implement Ienumerable
This solution can help you: var dt = new System.Data.DataTable(); dt.Load(rdr); var enumerableTable = (dt as System.ComponentModel.IListSource).GetList(); Chart1.DataBindTable(enumerableTable,…
-
2
votes1
answer123
viewsA: Sql - Database Modeling
Whereas its tables already created contain the following structure: Tabela Usuarios PK idUsuarios int Nome varchar(30) NomeCompleto varchar(255) Table Products PK idProdutos int Descricao…
-
5
votes3
answers614
viewsA: How to create a custom list using data from four tables?
Follow a query Linnum and another lambda. This is just another way to solve. Variables to use in LINQ var notas = new List<Nota>(); var fornecedores = new List<Fornecedor>(); var…
-
1
votes2
answers99
viewsA: Return values less than 10 from a column with Datediff
You can turn your query into a sub-consultation, and from it, get by the column INDISPONIBILIDADE records under 10 and/or between 10 and 20. SELECT T.DATA_DEVOLUÇÃO, T.INDISPONIBILIDADE,…
-
2
votes1
answer467
views -
1
votes4
answers150
viewsA: How to use unsafe code on a Web Site
Add in your Web.Config the following tag: <configuration> ... <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/unsafe"…
-
2
votes2
answers904
viewsA: Generate empty row (null) in sql server
You can generate a table with numerical sequences (omitting your data) and link with your original search. The TOP 10 you will specify how much you want. WITH gerador (id) AS ( SELECT 1 UNION ALL…
-
1
votes2
answers49
viewsA: Datapicker Mysql
Search the value of the property Date in this control. var cmd = new MySqlCommand("SELECT distinct id, Carro, Placa, Fabricante, Ano, Cor, Data FROM Novo WHERE Data = '"+ DatePicker.Date +"'",…
-
6
votes1
answer858
viewsA: Error trying to connect via ODBC to Mysql
Access the Server as root mysql -u root -p -h localhost And grant the privilege to the user GRANT ALL PRIVILEGES ON *.* TO 'reports'@'localhost' IDENTIFIED BY 'sua senha'; FLUSH PRIVILEGES; Syntax…
-
2
votes1
answer27
views -
4
votes0
answers83
viewsQ: How to insert references to use the Scriptengine class?
On the basis of the question Compile string as code includes in my project the class ScriptEngine, however, it is not being found in the references: using Microsoft.CodeAnalysis.Scripting; using…
-
3
votes0
answers41
viewsQ: How to create an expression evaluator?
I am creating a program that will allow the user to create and execute their own expressions. Looking into it, I found the Compute of DataTable. Ex: DataTable dt = new DataTable(); var exp =…
-
1
votes1
answer1227
viewsA: Get the previous record of a date
Solution for SQL Server I used the WITH to create a support table with a new column generated by ROW_NUMBER. In the survey, I searched the record immediately prior to the maximum existing records in…
-
7
votes4
answers977
viewsA: Separate repeated values in a list
Use the Distinct to return the different elements from your list. using System.Linq; List<int> lista = new List<int> { 1, 1, 1, 2, 2, 1, 5, 3, 4, 3, 4 } ; lista.Distinct();…
-
1
votes3
answers167
viewsA: Inherited Form comes with no editing option on the whole. Use C# and VS 2017
The appeal Lock Controls has been activated on your form. By activating this option, all controls were marked with this cardeado, indicating that cannot move or resize them. You can lock/unlock…
-
4
votes1
answer1327
viewsA: How to do GROUP BY in UNION ALL?
To perform the necessary grouping, you will need to use the aggregation function SUM. And clear the field amount of group by. String sql= @"SELECT DESCRICAO, SUM(QUANTIDADE) FROM (" + instrucao1 +…
-
3
votes1
answer703
viewsA: Add cases to a query
You can use the else in his case: WITH SOMATORIA (SOMA_TOTAL) AS (SELECT CASE WHEN sd3_sub1.D3_UM = 'PC' THEN sum(sd3_sub1.D3_QTSEGUM) ELSE sum(sd3_sub1.D3_QUANT) END AS D3_QUANT FROM SD3010 AS…
-
2
votes1
answer42
viewsA: How to make a button addition system with unique events for Launch?
You will need to create an event at your control. Use the Addhandler, see: AddHandler mbtn.Click, AddressOf mbtn_Click Then state your function mbtn_Click: Private Sub mbtn_Click(ByVal sender As…
-
2
votes1
answer433
viewsA: How to select multiple columns using the table prefix only once?
The best solution to your problem will really be the field-to-field declaration with its due Alias. Obviously you can use the wildcard character *, consider the syntax: [PREFIX]. * or [TABLE NAME].*…
-
4
votes2
answers4543
viewsA: Handle spreadsheet with userform loaded (excel vba)?
Yes! Set the property ShowModal for false.…
-
4
votes1
answer202
viewsA: As per comments on user defined function in Excel/VB
To include this description without using Exceldna, I used the function properties (Accessed by Object Researcher F2). See below:…
-
4
votes1
answer27
viewsA: Check if dynamic named file exists on disk
Perform the elimination with the help of foreach using the filter desired in GetFiles: System.IO.DirectoryInfo di = new DirectoryInfo(@"C:/caminhoDosFicheiro"); foreach (FileInfo file in…
-
1
votes2
answers71
viewsA: Data query file Settings
You can use the feature "Copy As Link". In your project B, go to the option to add an existing item, and choose the project A configuration file and add as a link. See the images: See also.…
-
0
votes1
answer59
viewsA: Print message on next page
For the same case, the following reply helped me, see her below: When using the setFlash, you can provide a key value, for example: $this->Session->setFlash('This message is for form 1.',…
-
1
votes1
answer102
viewsA: What is "-1. #IND" in VB.NET
Negative Undefined "-1. #IND" The NaN Indefinido, which is a special kind of NaN silent is generated under specific conditions. If you run a invalid arithmetic operation how to add positive infinity…
-
3
votes1
answer256
viewsA: Application does not open in windows XP because it does not have administrator permission
You should add a manifest in its application. Project Menu > Add New Item... and then choose the type Application Manifest File: After this, you should determine the level of permission for…
-
9
votes2
answers2773
viewsA: Run more than one project in Visual Studio
In the solution properties (right click), you can configure it as "Multiple startup Projects" and choice in combo "Action" the desired option. See in the image below:…
visual-studioanswered Ismael 4,781 -
16
votes3
answers703
viewsA: Can I remove all the using I’m not using?
Right-click (in the code window) to access the option > Organize Usings > Remove Unnecessary Using. You will not have any problems in your code, as you can add them again. Some related posts…
-
3
votes1
answer1166
viewsA: Dapper Framework Error: Could not load file or Assembly 'Dapper, A strongly-named Assembly is required
Tried to install the PM (Package Manager Console) > Install-Package Dapper.StrongName? Reference: Dapper dot net (Strong named) 1.50.2 Post gingo muito bom sobre.…
-
8
votes1
answer3228
viewsA: Problems with entering data in the float field in MYSQL
Formalizing the answer: The mistake happens because the float does not keep exact details - and approximate, for this (monetary values), we should use the decimal... The decimal in Mysql has the…
-
1
votes2
answers411
views -
5
votes1
answer466
viewsA: Reload Datagridview in C#
The reference to datasource still continues, even after another click. Force cleanup for a successful upgrade. Add the line: dataGridView1.DataSource = ""; private void button3_Click(object sender,…
-
4
votes1
answer99
viewsQ: What is the usefulness of the "Add Fakes Assembly" feature?
Beyond utility, how can we implement it? I could not find documentation in Portuguese that would clarify this functionality much less examples of how to apply it.…
-
1
votes1
answer674
viewsA: SP2-0552: Unstated Bind variable "19"
I believe that the fraction of seconds that you are using separately, is wrong, being the correct separate with point; The mask for the fraction of seconds is defined by the FF; The value saved in…
-
1
votes1
answer80
viewsA: Relationship between tables n to n
Formalizing the answer (cited in Havenard’s commentary), the ADD before the command foreign key: alter table xicara_cafe add foreign key (id_cafe) references cafes(id_cafe); alter table xicara_cafe…
-
4
votes2
answers2390
viewsA: Underline a word within a Textview
You can use the method Html.fromHtml -> Spanned fromHtml (String source) Spanned text = Html.fromHtml("Abelha <b>Barco</b> Casa Dado"); textView.setText(text); This method is obsolete…