-1
I’m trying to create a very simple login system, I’m new to programming and I’m still learning and I came across a mistake, The compiler does not present any errors however when running and trying to log in even with right or even wrong data when clicking the access button it presents this error. this is my first question so if I forgot something please correct me and ask.
I already modified the string in several ways but the error persists, the Sqlservver service is running correctly and at first connected to the visual studio. follow the code to see if you can help me.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.OleDb;
namespace TesteDeLogin3
{
public partial class TelaDeLoguin1 : Form
{
public TelaDeLoguin1()
{
InitializeComponent();
}
private void btnsair_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnacessar_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=DESKTOP-LHJNB75;Initial Catalog=BancoDeLogin;Integrated Security=True;Pooling=False");
SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) *From Table where usuario=' " + txbuser.Text + "' and senha ='" + txbsenha.Text + "'", con);
DataTable dt = new DataTable();
sda.Fill(dt);
if (dt.Rows[0][0].ToString() == "1")
{
this.Hide();
TelaDeEntrada ss = new TelaDeEntrada();
ss.Show();
}
else
{
MessageBox.Show("Por favor verifique as informaçoes digitadas e tente novamente");
}
}
private void TelaDeLoguin1_Load(object sender, EventArgs e)
{
this.tableTableAdapter.Fill(this.bancoDeLoginDataSet.Table);
}
}
}
Try taking the
*
that’s glued to theFrom
. Instead of*From
, will beFrom
– Rafael Tavares
I made the modification but the error continues
– Reimur