Login Screen



Login Screen..

Answer / santro

/*Loginscreen.aspx.cs*/
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class loginScreen : System.Web.UI.Page
{
string strConnectionstring;
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Login1_Authenticate(object sender,
AuthenticateEventArgs e)
{
strConnectionstring =
ConfigurationManager.AppSettings["strLogin"];
SqlConnection con = new SqlConnection
(strConnectionstring);
//SqlConnection con = new SqlConnection
("username=bhushan;password=softima;initial
catalog=sample;data source=localhost");
con.Open();
SqlCommand cmd = new SqlCommand("select count(*)
from login where username='" + Login1.UserName + "'and
password='" + Login1.Password + "'", con);
int i = (int)cmd.ExecuteScalar();
if (i > 0)
{
//FormsAuthentication.RedirectFromLoginPage
(Login1.UserName, Login1.RememberMeSet);
Response.Redirect("pgDrugNames.aspx");
}
}


}
/*Web.config
<appSettings>
<add key="strLogin" value="user
id=sa;password=sasa;initial catalog=sample;data
source=localhost" />
<add key="strSample" value="user
id=sa;password=sasa;initial catalog=sample;data
source=localhost" />
</appSettings>*/

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Everything Else AllOther Interview Questions

valuation of share is it base of the company reputation

0 Answers  


There is an urgent need of SBI PO syllabus and previous & solved question papaer... please also refer the book for the entrance exam...please Send the syllabus and question paper at my email id itsam86@gmail.com

0 Answers  


i want 2 know that is there any connection between INTERVIEW DATE AND MARKS OBTAINED IN TEST OF SBI CLERICAL OF ASSOCIATED BANKS ? AND WHAT IS GOING 2 BE THE DIFFERNCE OF Marks among the candidates who have been called for INTERVIEW?im Bhushan MAlik from punjab , my interview is on 29th may AT JALANDHAR CITY , panel 2 ?my cell nom is 9988017661 and email address is bhushan_malik1986@rediffmail.com

0 Answers   State Bank Of India SBI,


In whose memory National Youth Day is celebrated?

1 Answers  


If I dont feign to have a disability, whether it be mental or physical, to get state money, or money from S.S.I but let the people who really need the money have it instead, such as children and severly disabled people. But choose to activley look every day for employment, but do not find employment and end up living on the streets because I can no longer pay my rent, at what point does it NOT become my fault? Is there a time when I should simply follow the rest of the people over the cliff?

1 Answers  






How many times does the minute hand meet the hour hand in a day?

45 Answers   BPO, WNS,


hi guys! i am selected for sbi clk exam held on 01.03.2009. i am having interview on 27-05-09. guys any body having interiew before that pls post interview questions to b_praveen_raj@yahoo.com

0 Answers   State Bank Of India SBI,


plz guide & send me sbi bank & svc bank clearical exam pattern & study materials on my email id balkrishna02@yahoo.com

0 Answers  


during the announcement of group 1(APPSC)preliminary results they said in press meet that the results of assistant executive engineer results would also be released in 2 days interviews would held om june 10th but after 10 days also there is no announcement of results and interview date is fast approaching can any body suggest what to do next

0 Answers  


How to enable network in solaris Single usermode ?

0 Answers   HCL,


Hi all, am rahini and i completed my BE in 2005 still searching for a job. and i have done testing course (manual+winrunner).now am searching for job please help me in getting projects.pleae guide me how to get projects

1 Answers  


Which is the tallest building in the world?

0 Answers  


Categories