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 |
what is a meaning of self movitate
whatis type?
Perform the following arithmetic operations using 8- bit binary signed 1’s and signed 2’s complement notation for integers. (Please note that the numbers given here are in decimal notation) (3 Marks) i) Add – 52 and 68 ii) Subtract 66 from – 62 ii) Add 28 and 100 Please indicate the overflow if it is occurs.
A 5 mints time is given to you to say atleast 50 words ,which dont contain ABCD?
I am Master with Statistics, MBA(finance and marketing)and SAS base training taken , seaching jobs in SAS analyst after 12 working in education as educator for statistics
Who built Hyderabad?
why do you want to job in ntpc
tell me about yourself ?
Could anyone help me in knowing the address of Nageshwar Rao Institue in SR Nagar. How many months does he take to complete the course in Manual Testing? What would be the fee? Kindlu suggest any other best institutes for MANUAL TESTING with the faculty name.
How many hardisks can you connect to a IDE?
why do we need to train employees?
Tell me something about your 2 strong point and 2 weak point