Questions tagged as 'c#'

1
answer

How to escape the SqlDataSource.FilterExpression?

I have a function that adds a filter to SqlDataSource . This expression contains LIKE in the query. However, if the person places a character as ' , an error occurs (evidenced by SQL Injection). string cliente = TB_Cliente.T...
asked by 06.12.2017 / 12:46
3
answers

Load DataGridView with MySql

I have the following problem to display the data in a gridView pulling from the MySQL database public string CarregarAluno() { string retorno = ""; string sql = "select * from alunos"; MySqlConnection conn...
asked by 29.11.2017 / 12:05
1
answer

SSL / TLS error while attempting to perform Sky API transaction

During all week I had problems in the calls to their API, I get only the following error:    The underlying connection was closed unexpected error in a submission My code called in RestSharp is: public Transaction Transaction_CreditCard...
asked by 17.08.2018 / 14:26
1
answer

Error creating XML with XmlWriter

I need to create an XML, but when I try to create 2 elements of the error, how do I generate 1 XML with two elements? follow my code class Program { static void Main(string[] args) { using (XmlWriter writer = XmlWriter.Create(...
asked by 20.08.2018 / 21:20
3
answers

How do I access the elements of a declared list in a different class?

I've developed code that generates a list when the following input data is entered: Size of the list (or how many " Indexes") The values that will populate the " Indexes ". Values are collected within a method entered in the public...
asked by 03.11.2017 / 22:58
1
answer

Syntax error in final key

In my code the following errors are appearing:    Error 1} expected **       Error 2 Type or namespace definition, or end-of-file expected ** using System; using System.Collections.Generic; using System.Linq; using System.Text; using Test...
asked by 07.11.2017 / 12:46
1
answer

How do I visualize through breakpoint what values were passed to my method?

I would like to know if it is possible without using Debug.WriteLine to view the values passed to my method through Visual studio using a BreakPoint, either by some external resource or not.     
asked by 09.11.2017 / 17:57
1
answer

Best way to implement Toledo 4Unew Balance? [closed]

Good afternoon, I bought a toledo Prix 4Uno scale with communication via ethernet. I would like to know if there are any examples in C # to implement communication with it, or if it is only via MGV 6 software. Any starting foot tip is alre...
asked by 13.10.2017 / 21:40
1
answer

Open and close connection every time looping

I have an application that executes a procedure , saves it to a DataTable and then makes a looping to add the data to an excel worksheet. My question is, if I open and close the connection every insert will increase th...
asked by 10.10.2017 / 15:03
1
answer

How to handle an index range exception?

I have an exception problem in my program and I'm not sure how to handle it. The error image in the DataGridView follows. privatevoidDGW_solictacao_CellClick(objectsender,DataGridViewCellEventArgse){DataGridViewRowrow=this.DGW_solictacao....
asked by 11.10.2017 / 15:26