Hi
Login is getting loaded but not showing message . Below are the Forms
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Login());
}
}
public partial class Login : Form
{
SqlCommand cmd;
SqlConnection cn;
SqlDataReader dr;
public Login()
{
InitializeComponent();
}
private void Login_Load(object sender, EventArgs e)
{
MessageBox.Show("connecting with sql server");
SqlConnection cnn = DatabaseConnection.GetInstance();
//execute queries
string query = "SELECT * FROM Login";
SqlCommand command = new SqlCommand(query, cnn);
cnn.Open();
DataSet ds = new DataSet();
MessageBox.Show("connect with sql server");
}
private void Btnregister_Click(object sender, EventArgs e)
{
//this.Hide();
////Registration registration = new Registration();
//registration.ShowDialog();
}
}
Thanks
Ramco RamcoPosted Aug 14, 2024, 1:18 PM
Hi Jignesh
I tried this . Buttin is getting displayed in Login Form. I think it is not going in
Login_Load function
Thanks
Jignesh KumarPosted Aug 14, 2024, 1:11 PM
Hello Ramco,
Could you please try below code,