Posts by Joy Peter • 468 points
32 posts
-
0
votes1
answer32
viewsA: Modeling Error Asp.net Code First
Models: public class Croqui { [Key] public int CroquId { get; set; } public int LaudoId { get; set; } [ForeignKey("LaudoId")] [InverseProperty("Croquis")] public virtual Laudo Laudo { get; set; }…
-
0
votes3
answers103
viewsA: Send error for duplicate login C#
public ActionResult Autenticar(string login, string senha) { try { var usuarios = db.Usuarios.Where(p => p.Login == login && p.Senha == senha); if(usuarios.Count==0) {…
-
0
votes2
answers979
viewsA: Convert value to C#object
First creates the class with the return property public class PropriedaRetorno { public string Aplicacao { get; set; } public string Retorno { get; set; } public string Sequencial { get; set; }…
-
1
votes4
answers737
viewsA: How do I close the form I’m in?
It does not close due to ShowDialog() private void BtnEntrar_Click(object sender, EventArgs e) { string login = txtLogin.Text; Conta conta = new Conta(); try { BLL bll = new BLL(); conta =…
-
0
votes1
answer272
viewsA: Check if the user has authenticated, and get authenticated user information
To verify authentication with Asp.NET MVC, the [Authorize], it checks if the user is authenticated. You always put it in controller: Authentication To restrict just a page or an action [Authorize]…
-
0
votes2
answers46
viewsA: Log datagridview data into a table in the database
Your mistake was creating the loop, there’s no need to use a loop if you want to grab a line, it’s iterating and it’s inserting all the rows into the database. The solution would be like this: try {…
-
1
votes2
answers97
viewsA: Pulling repeated data from the database to Datagridview
According to your code the solution would be to clear the list before loading, could use the this.dgvDados.Rows.Clear(); Would look like this: public void CarregarGrid() { try{ //…
-
4
votes5
answers5490
viewsA: Count the number of months between one date and another
static int GetQtdMoth(DateTime inicio, DateTime fim) { int years = fim.Year - inicio.Year; if (years < 0) return 0; if (years == 0) return fim.Month - inicio.Month; int meses = 12 - inicio.Month;…
-
3
votes2
answers1131
viewsQ: onDataChange(), in addListenerForSingleValueEvent(), is only executed after my method returns
I’m trying to check if a given email exists, with android using firebase I’m doing this way : public boolean existeEmail(String email) { final boolean[] retorno = new boolean[1]; final…
-
1
votes1
answer518
viewsA: How to Replace Characters with Other with C#
string string1 = "44 / 44 / 55"; string string2 = string1.Replace(" / ",";");
-
0
votes3
answers49
viewsA: Send information from a Viwer Data grid to sql database
void AddPedidos(DataGridView dgvPedido) { for(int i=0;i<dgvPedido.rowcount;i++){ string pos0=dgvPedido[0,i].value.ToString(); string pos1=dgvPedido[1,i].value.ToString(); //insira o código para…
-
2
votes1
answer41
viewsA: Make the console take a value from another class in C#
using System; using namespaceb; namespace namespaceb { public class saldo { public int numero = 100; } class Program { static void Main(string[] args) { saldo teste = new saldo();…
-
6
votes1
answer611
viewsQ: Get user location without using GPS
Hello. I’m developing an application on android that you need to notify a group of users who are in a certain region. The only way I know how to get the user’s location is by using GPS. The problem…
-
1
votes1
answer49
viewsA: How to create a Mesagebox by listing data in c#?
this is the class: class Lista_de_produto { public string Nome_produto { get; set; } public int qtd { get; set; } public List<Lista_de_produto> GetAll() { List<Lista_de_produto> g=new…
-
2
votes1
answer238
viewsQ: How to use a Sqlserver script to create a database in Sqlite?
I have a generated script from SQL Server it contains multiple tables and views, I plan to carry this database to my Android Sqlite. How do I run the script on Sqlite on Android ?…
-
0
votes1
answer471
viewsQ: Transfer data from SQL Server to Sqlite with Android
I have a software that is connected to an SQL Server database, but now I am making the software on Android using Sqlite. I need to transfer the SQL Server database (with the data) to my Sqlite.…
-
3
votes1
answer42
viewsA: Even zeroed sum
Code: #include <stdio.h> int somapar(int vet[], int n) { int soma = 0, i; for (i = 0; i < n; i++) { if (vet[i] % 2 == 0) soma = soma + vet[i]; } return soma; } int main() { int v[20] = { 2,…
-
0
votes3
answers15260
viewsA: How to insert an image in my html doc to serve as background image(background)
css body { background-image: url("caminho_da_imagem.extensao"); }
-
2
votes4
answers9132
views -
2
votes2
answers117
viewsQ: event with jquery
In Html we have: <div id="t1" > </div> <div id="t2" > </div> <div id="t3" > </div> No js temo: var aux="#t"; var count=0; $(document).ready(function(){…
-
2
votes1
answer29
viewsA: How to make a component with variables of different types?
Procedimento Resultado (A, C, D, F: Inteiro; B: Real)
-
0
votes3
answers269
viewsA: How to search and save a single field?
public void Salvar() { using (var ctx = new ExemplosEntities()) { var Cidade = ctx.Cidade.First(c => c.IdCidade == 1); Cidade.Nome = "São Carlos"; ctx.SaveChanges(); } } check on this: var Cidade…
-
0
votes1
answer93
viewsA: Pass data from a Datagridview to Textboxes in C#
//ESTE É O FORM DA EDIÇÃO public partial class frm_edit : Form { public string Nome; public int Idade; } // este é o evento load do form da edição private void frm_edit_Load(object sender, EventArgs…
-
4
votes1
answer545
viewsQ: Error while running Eclipse after Windows 10 installation
When using the Windows 8 Eclipse worked normally now that I installed Windows 10 every time I try to execute I have this message:…
-
0
votes3
answers641
viewsA: Add zeros right Textbox C#
private void textBox1_Leave(object sender, EventArgs e) { textBox1.Text = Convert.ToDouble(textBox1.Text).ToString("N2"); }
-
1
votes5
answers839
viewsA: How can I add a value to a Row in the comic without having to add variables?
SELECT saldo FROM tabela; while (...) { saldo =saldo +50; }
-
0
votes2
answers124
viewsA: Passing variable values in ASP.NET and Mysql
MySqlConnection con = new MySqlConnection("caminho da base de dados"); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = con; con.Open(); cmd.CommandType = CommandType.Text; string fu =…
-
0
votes2
answers216
viewsA: Perform Insert into in c#List
tb_User tb = new tb_User (); tb.Nome="Manuel"; tb.Idade=30; DB.DB.AddTotb_User(tb); DB.DB.Connection.Open(); DB.DB.SaveChanges(); DB.DB.Connection.Close(); Entity Framework.…
-
2
votes3
answers18706
viewsA: Use of select with SUM() function
SELECT sum(nota1) AS 'Media Final' FROM boletim_escolar GROUP BY id_codaluno Decimal N1='Soma da primira nota'*1 SELECT sum(nota2) AS 'Media Final' FROM boletim_escolar GROUP BY id_codaluno Decimal…
-
1
votes5
answers870
viewsA: Doubt with foreach com group by Asp.net mvc
//criar uma classe public class Titulos_ Na_lista { public string Titulo { get; set; } } // aqui é a tua página List<Titulos_ Na_lista> Ver = new List<Titulos_ Na_lista>(); public bool…
-
3
votes5
answers870
viewsA: Doubt with foreach com group by Asp.net mvc
I don’t quite understand the doubt, but I think this should help: <div> <label>Utilizadores: </label> <% string [] F = new string[6]; F[0] = "Paulo Mendes"; F[1] = "Pedro…
-
0
votes2
answers121
viewsA: 2 Datagridview when clicking the first play the record in 2?
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.RowCount > 0) { CODIGO = Convert.ToInt32(dataGridView1[0,…