Answer Posted / 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 View All Answers
hi frnds ny idea ke sbi po ka result kb tak ayega?? plz join this thread n share imp n relevent information..
What about our position do you find the most and least attractive?
Why do you want to work for our company??
What is differant about upload as opposed to download?
What are advantages and disadvantages of Nuclear power?
i m from engineering background and now i want to go banks....if the question will asked that why u prefer the bank job while u r from technical background?
What is F.O.R.
How many times fill return of PF and ESI by the company?
hello everybody! I am soumali ,pursuing MBA with HR as a specialization,and going to face my first placement interview,plz hep me to knw that wht type of important quetions which i will face regarding my HR specialization. wht will be the answer of Q1 WHY U HV SELECTED HR AS A SPECIALIZATION? Q2 Where do you see urself from 3-5yrs from now as a HR in the company? Q3 What will be ur career goals or career path as a HR? PLZ GV ME the answers of above questions?
What was the cut off for SSC Tax assistant examination in previous year and what may be the cut off this year?
I am selected as DEO IN kerla cag anybody wants mutual transfer i want in northern india Like up delhi punjab etc Call me 7275639235 7275219235
what is CTD format?
What are your views regarding going on a mission humanitaire(www.mission-humanitaire-afrique.org) with shammesh?
am getting tired often and getting bored,distracted while doing or learning something....but am having high ambition and intention to do something big....how should i overcome my tiredness and stay focussed??
sir i got a call from cabinet secretariat regarding i got selected in dfo(gd) 2013 on 28/5/2016 to come for filling of some details in my interview attestation form,which i submitted.Now when will my verification be completed and got the appointment letter.Is anybody got the same