Posts by Lucas Bustos • 97 points
10 posts
-
1
votes1
answer50
viewsQ: How to pass a decimal type variable to a string type sql command with decimal separator "."?
I have the following Model class: public class ModelTransaction { public int Id { get; set; } [Required(ErrorMessage = "Informe a data")] public string Date { get; set; } [Required(ErrorMessage =…
-
1
votes0
answers46
viewsQ: How to fill a property (type Object) from a form
I have the following code @model ModelTransaction <div class="form-group"> <label for="name">Conta:</label> <select asp-for="Account" class="form-control"> @{ foreach…
-
1
votes1
answer481
viewsQ: Return selected object in datagridview
I have the following parameterization of my datagridview: List<ModelAluno> alunos; ModelAluno aluno = new ModelAluno(); public PesquisaAluno(List<ModelAluno> alunos) {…
-
0
votes0
answers276
viewsQ: Error entering data in datagridview
I have the following code: public partial class PesquisaAluno : Form { List<ModelAluno> alunos; public PesquisaAluno(List<ModelAluno> alunos) { InitializeComponent(); this.alunos =…
c#asked Lucas Bustos 97 -
0
votes1
answer105
viewsQ: Database based query listing
First of all, I apologise if the question is vague, as it is a very broad subject. Today I have a student registration and consultation system, where the query is made exclusively by CPF, since it…
-
0
votes1
answer72
viewsQ: Event pressing key 2 times
I have the following event: private void TelaAcao_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue.Equals(27)) { this.Close(); } } The result is that every time I press ESC, the form is…
c#asked Lucas Bustos 97 -
2
votes2
answers5112
viewsQ: What is a Dataset and what is its function?
Creating my first database applications (SQL Server), I connect by passing my string and using the Sqlcommand class to pass the query. But searching other sites, I see that access to the bank is…
-
-2
votes1
answer226
viewsQ: C# - Pass only numbers in a field formatted for currency
I have an application that presents me in a textbox the value of a course enrollment: string mensalidade = string.Format("{0:C}", Convert.ToDouble(leitura["Mensalidade"]));…
-
0
votes1
answer99
viewsQ: Problems with executescalar (System.Data.Sqlclient.Sqlexception)
I have the following block of code: sqlConn.Open(); SqlCommand inserirAluno = new SqlCommand("INSERT INTO ALUNOS (Nome, DataNascimento, CPF, Endereco, Bairro, " + "CEP, Cidade, IdEstado, Sexo)…
-
2
votes1
answer1022
viewsQ: Recover last inserted id and selected stroke
I have the following situation: On the same form, I insert a student: SqlCommand inserirAluno = new SqlCommand("INSERT INTO ALUNOS (Nome, DataNascimento, CPF, Endereco, Bairro, " + "CEP, Cidade,…