Hi,
Error1:-loginpage.Loginform.dt' is a 'field' but is used like a 'type'.I am underlined the error point.what ever it shows.Please do the neeful
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace loginpage
{
public partial class Loginform : Form
{
DataTable dt = new DataTable();
BEClass being = new BEClass();
DALClass dac = new DALClass();
public Loginform()
{
}
private void btn_login_Click(object sender, EventArgs e)
{
string uname = txt_username.Text;
string upassword = txt_password.Text;
if (txt_username.Text.Length != 0 && txt_password.Text.Length != 0)
{
dt table= dac.loginform(uname, upassword);
if (dt.Rows.Count > 0)
{
Homepage hp = new Homepage();
hp.Show();
this.Hide();
}
else
{
MessageBox.Show("Login Failed......", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
txt_username.Text = "";
txt_password.Text = "";
}
}
}
private void btn_reset_Click(object sender, EventArgs e)
{
txt_username.Text = "";
txt_password.Text = "";
}
private void Loginform_Load(object sender, EventArgs e)
{
txt_username.Focus();
}
}
}
Error 2:-Only assignment, call, increment, decrement, and new object expressions can be used as a statement.I am underlined the error point.what ever it shows.Please do the neeful
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data .SqlClient ;
using System.Data ;
using System.Configuration ;
namespace loginpage
{
public class DBConnection
{
public SqlConnection opencon()
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["imapct services"].ConnectionString);
con.Open;
return con;
}
Best,
Sudheep.
Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator