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 |
Does anyone know some strategies for the free android game Grand Battle? Need you help!! I really love the game Grand Battle, and I fell excited when I defeat the enemies and protect my base as a commander. Now I think I need some strategies to improve my performance and to lead a strong army, could anyone help me? Thank you so much!
name the places where the indian govt has given its nod to set up four new tiger resereviors?
Who is the Best cricketer Now...is is still sachin or any?
can anybody tells me about the latest walkin for M.C.A in software companies?
Had you thought of leaving your present position before? If yes, what do you think held you there? 11. What are your strong points? 12. What are your weak points? How long would you stay with us?Why are you leaving your present position? 48. What are your career goals? Why should we hire you?How much do you expect if we offer this position to you?
What is mean by stacking?
What are the test cases for booking one ticket for same movie, for same time but many users.
In which court was a Chinese embassy sent by T'ang emperor?
What can you do for us that someone else can't?
Which language was mostly used for the propagation of Buddhism in ancient period
Can any one know the questions asked by Federal bank in Interviews?I cleared both PO and Clerk Exams held on 2009. If any One Know that Pls help me..Unni
hi, pls suggest me.... i m doing software testing now. i hv changed my field Bsc bio to comp. sci. my graduation is completed with bio science then PG with M.A. (eco.), after that i switched in PGDIT(comp. Diploma). and with this my percentage is in reversing order from 10th to M.A. so what should i reply for changing fields and decreasing percentage, if i face these questions in interview???