Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
QuestionWhich editor is the best Pin
emran83421-Mar-06 9:19
emran83421-Mar-06 9:19 
AnswerRe: Which editor is the best Pin
Dan Neely21-Mar-06 9:38
Dan Neely21-Mar-06 9:38 
GeneralRe: Which editor is the best Pin
emran83421-Mar-06 9:41
emran83421-Mar-06 9:41 
GeneralRe: Which editor is the best Pin
Steve Pullan21-Mar-06 12:04
Steve Pullan21-Mar-06 12:04 
AnswerRe: Which editor is the best Pin
Allah On Acid21-Mar-06 12:44
Allah On Acid21-Mar-06 12:44 
GeneralRe: Which editor is the best Pin
Sean8921-Mar-06 13:07
Sean8921-Mar-06 13:07 
GeneralRe: Which editor is the best Pin
Sean Michael Murphy21-Mar-06 14:08
Sean Michael Murphy21-Mar-06 14:08 
AnswerRe: Which editor is the best Pin
Ahmad Mahmoud [candseeme]21-Mar-06 21:46
Ahmad Mahmoud [candseeme]21-Mar-06 21:46 
AnswerRe: Which editor is the best Pin
Vasudevan Deepak Kumar21-Mar-06 21:50
Vasudevan Deepak Kumar21-Mar-06 21:50 
GeneralRe: Which editor is the best Pin
spin vector22-Mar-06 1:14
spin vector22-Mar-06 1:14 
QuestionNetSend Pin
DreistRichie21-Mar-06 8:37
DreistRichie21-Mar-06 8:37 
Questionserial communication Pin
deepak saraogi21-Mar-06 8:10
deepak saraogi21-Mar-06 8:10 
Questionaccess a progressbar control on the parent from the child form Pin
ESTAN21-Mar-06 8:10
ESTAN21-Mar-06 8:10 
AnswerRe: access a progressbar control on the parent from the child form Pin
DaBears24-Mar-06 4:52
DaBears24-Mar-06 4:52 
QuestionStrings in Hex Pin
gmhanna21-Mar-06 7:57
gmhanna21-Mar-06 7:57 
AnswerRe: Strings in Hex Pin
Guffa21-Mar-06 8:54
Guffa21-Mar-06 8:54 
QuestionNeed help with GAC and Register updates from Custom Installer Pin
LongRange.Shooter21-Mar-06 7:15
LongRange.Shooter21-Mar-06 7:15 
AnswerRe: Need help with GAC and Register updates from Custom Installer Pin
LongRange.Shooter21-Mar-06 10:32
LongRange.Shooter21-Mar-06 10:32 
Questionhow i can translate word from english to arabic and vise verse using word object in c# Pin
Ortiga21-Mar-06 6:05
Ortiga21-Mar-06 6:05 
AnswerRe: how i can translate word from english to arabic and vise verse using word object in c# Pin
LongRange.Shooter21-Mar-06 7:24
LongRange.Shooter21-Mar-06 7:24 
QuestionProtect Media Files Pin
Kostas Dak21-Mar-06 5:45
Kostas Dak21-Mar-06 5:45 
AnswerRe: Protect Media Files Pin
Ahmad Mahmoud [candseeme]21-Mar-06 22:38
Ahmad Mahmoud [candseeme]21-Mar-06 22:38 
Question"Reactivating" Form Pin
MarcoNedwig21-Mar-06 5:45
MarcoNedwig21-Mar-06 5:45 
QuestionSelection problem with Custom Control for CF Pin
rnvrnv21-Mar-06 5:42
rnvrnv21-Mar-06 5:42 
Questionplease help me, i cant find the way out Pin
yamacom21-Mar-06 5:30
yamacom21-Mar-06 5:30 
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Personal_WebPage
{
///
/// Summary description for WebForm1.
///

public class Login : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlTable tblContent;
protected System.Web.UI.WebControls.Label lblUser;
protected System.Web.UI.WebControls.Label lblPass;
protected System.Web.UI.WebControls.TextBox txtUser;
protected System.Web.UI.WebControls.TextBox txtPass;
protected System.Web.UI.WebControls.Label lblError;
protected System.Web.UI.WebControls.Button btnLogin;
protected System.Web.UI.HtmlControls.HtmlTable tblHeaderMF;
protected System.Web.UI.HtmlControls.HtmlTable tblMenuMF;
protected System.Web.UI.HtmlControls.HtmlTable tblFooterMF;
protected System.Web.UI.HtmlControls.HtmlTable tblFrame;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void btnLogin_Click(object sender, System.EventArgs e)
{
string ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0 " +
";Data Source= C:\\Inetpub\\wwwroot\\Personal_WebPage\\Database.mdb";
Search(ConnectionString);
}

private void Search(string ConnectionString)
{
string SQLcmd;
string strUser, strPass;
bool Check=false;

OleDbConnection conn = new OleDbConnection(ConnectionString);
conn.Open();

strUser = txtUser.Text;
strPass = txtPass.Text;
SQLcmd = string.Format("select UserName,PassWord from tblAccount where UserName = {0} and PassWord = {1}",strUser,strPass);
OleDbCommand cmd = new OleDbCommand(SQLcmd,conn);

OleDbDataReader objReader;
objReader = cmd.ExecuteReader();

while (objReader.Read())
{
if ((objReader.GetString(0) != "") && (objReader.GetString(1) != ""))
Check = true;
}
if (Check==true)
Response.Redirect("MainFrame.aspx");
else
{
lblError.Visible=true;
Response.Redirect("Login.aspx");
}

objReader.Close();
conn.Close();
}
}
}

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.