Click here to Skip to main content
15,912,897 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: GDI+ drawing - invalidate big rectangle in one user control then invalidate another user control (problem with big rectangle) Pin
rudozkv_new27-Oct-09 23:18
rudozkv_new27-Oct-09 23:18 
GeneralRe: GDI+ drawing - invalidate big rectangle in one user control then invalidate another user control (problem with big rectangle) Pin
freakyit27-Oct-09 23:34
freakyit27-Oct-09 23:34 
GeneralRe: GDI+ drawing - invalidate big rectangle in one user control then invalidate another user control (problem with big rectangle) Pin
rudozkv_new28-Oct-09 3:16
rudozkv_new28-Oct-09 3:16 
GeneralRe: GDI+ drawing - invalidate big rectangle in one user control then invalidate another user control (problem with big rectangle) Pin
freakyit29-Oct-09 1:13
freakyit29-Oct-09 1:13 
AnswerRe: GDI+ drawing - invalidate big rectangle in one user control then invalidate another user control (problem with big rectangle) Pin
rudozkv_new28-Oct-09 23:09
rudozkv_new28-Oct-09 23:09 
Questionc#.net Pin
Amit Spadez26-Oct-09 23:38
professionalAmit Spadez26-Oct-09 23:38 
AnswerRe: c#.net Pin
Shameel26-Oct-09 23:59
professionalShameel26-Oct-09 23:59 
GeneralRe: c#.net Pin
Amit Spadez27-Oct-09 0:03
professionalAmit Spadez27-Oct-09 0:03 
When i run tje application, it executes successfully but after entering the login info..there generates an error "Instance Failure"



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;

namespace Ads_Sertrack_System
{
public partial class frmLogin : Form
{
public frmLogin()
{
InitializeComponent();
this.MaximizeBox = false;
this.MinimizeBox = false;
this.StartPosition = FormStartPosition.CenterScreen;
this.WindowState = FormWindowState.Normal;
this.AutoSizeMode = AutoSizeMode.GrowOnly;
this.AutoSize = true;
}
SqlConnection conAdSertrack = new SqlConnection();
string strQry;
SqlCommand cmdLogin;
SqlDataReader dtrLogin;
public static int intLogInId;
public static string strUserName;
public static string strUserRole;

private void frmLogin_Load(object sender, EventArgs e)
{
try
{
conAdSertrack.ConnectionString = ConfigurationManager.ConnectionStrings["con"].ToString();
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void btnLogin_Click(object sender, EventArgs e)
{
try
{
errProvider.Clear();
if (txtUserName.Text == "")
{
errProvider.SetError(txtUserName, "Please Enter User Name");
MessageBox.Show("Please Enter User Name", "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtUserName.Focus();
}
else if (txtPassword.Text == "")
{
errProvider.SetError(txtPassword, "Please Enter Password");
MessageBox.Show("Please Enter Password", "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtPassword.Focus();
}
else
{
strQry = "select userid,username,userrole" +
" from tblusermaster where username = @paramUNm and pwd = @paramPwd";
cmdLogin = new SqlCommand(strQry, conAdSertrack);

cmdLogin.Parameters.Add("@paramUNm", SqlDbType.VarChar, 30).Value = txtUserName.Text;
cmdLogin.Parameters.Add("@paramPwd", SqlDbType.VarChar, 30).Value = txtPassword.Text;
if (conAdSertrack.State == ConnectionState.Closed)
{
conAdSertrack.Open();
}
dtrLogin = cmdLogin.ExecuteReader();
if (dtrLogin.HasRows)
{
dtrLogin.Read();

intLogInId = Convert.ToInt32(dtrLogin[0].ToString().Trim());
strUserName = Convert.ToString(dtrLogin[1].ToString().Trim());
strUserRole = Convert.ToString(dtrLogin[2].ToString().Trim());

frmMDI formMdi = new frmMDI();
formMdi.Show();
this.txtPassword.Text = "";
this.txtUserName.Text = "";

this.Hide();
}
else
{
MessageBox.Show("InValid User Name & Password", "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtUserName.Text = "";
txtPassword.Text = "";
txtUserName.Focus();
}
dtrLogin.Close();
conAdSertrack.Close();
}
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Innor Solutions Pvt. Ltd", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void btnCancel_Click(object sender, EventArgs e)
{
try
{
Application.Exit();
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
Application.Exit();
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void txtUserName_TextChanged(object sender, EventArgs e)
{
try
{
errProvider.Clear();
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void txtPassword_TextChanged(object sender, EventArgs e)
{
try
{
errProvider.Clear();
}
catch (Exception expMsg)
{
MessageBox.Show(expMsg.Message.ToString(), "Alpha Net Technologies Pvt. Ltd: Message Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
GeneralRe: c#.net Pin
Covean27-Oct-09 0:16
Covean27-Oct-09 0:16 
GeneralRe: c#.net Pin
Amit Spadez27-Oct-09 0:17
professionalAmit Spadez27-Oct-09 0:17 
GeneralRe: c#.net Pin
Covean27-Oct-09 0:20
Covean27-Oct-09 0:20 
GeneralRe: c#.net Pin
Amit Spadez27-Oct-09 0:24
professionalAmit Spadez27-Oct-09 0:24 
GeneralRe: c#.net Pin
Covean27-Oct-09 0:34
Covean27-Oct-09 0:34 
QuestionTabbed ListBox in a Web Page Pin
MarkyMark196126-Oct-09 8:21
MarkyMark196126-Oct-09 8:21 
AnswerRe: Tabbed ListBox in a Web Page Pin
Not Active26-Oct-09 8:31
mentorNot Active26-Oct-09 8:31 
GeneralRe: Tabbed ListBox in a Web Page Pin
MarkyMark196126-Oct-09 8:41
MarkyMark196126-Oct-09 8:41 
GeneralRe: Tabbed ListBox in a Web Page Pin
Not Active26-Oct-09 8:52
mentorNot Active26-Oct-09 8:52 
GeneralRe: Tabbed ListBox in a Web Page Pin
MarkyMark196126-Oct-09 9:00
MarkyMark196126-Oct-09 9:00 
GeneralRe: Tabbed ListBox in a Web Page Pin
Not Active26-Oct-09 9:05
mentorNot Active26-Oct-09 9:05 
GeneralRe: Tabbed ListBox in a Web Page Pin
MarkyMark196126-Oct-09 9:09
MarkyMark196126-Oct-09 9:09 
GeneralRe: Tabbed ListBox in a Web Page Pin
MarkyMark196126-Oct-09 9:04
MarkyMark196126-Oct-09 9:04 
GeneralRe: Tabbed ListBox in a Web Page Pin
Not Active26-Oct-09 9:08
mentorNot Active26-Oct-09 9:08 
GeneralRe: Tabbed ListBox in a Web Page Pin
Not Active26-Oct-09 9:36
mentorNot Active26-Oct-09 9:36 
AnswerRe: Tabbed ListBox in a Web Page Pin
Shameel26-Oct-09 8:43
professionalShameel26-Oct-09 8:43 
QuestionActive Directory DirectorySearcher fails when org unit is in LDAP root path Pin
redWingBB26-Oct-09 7:46
redWingBB26-Oct-09 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.