TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
gokilavasan m
NA
51
37k
help regarding session
Apr 27 2012 3:51 AM
How to use session in login page.In my login page i have
2labels
(username,password),
2 textboxes
and
1button
.
the following code is my login page using stored proc.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=ATSSERVER\\SQLEXPRESS;Initial Catalog=arun;User ID=sa;Password=mis@12345");
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd = new SqlCommand("chkusr",con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter s1 = new SqlParameter("@username", TextBox1.Text);
SqlParameter s2 = new SqlParameter("@password", TextBox2.Text);
cmd.Parameters.Add(s1);
cmd.Parameters.Add(s2);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
Response.Write("Login Success");
}
else
{
Response.Write("Login failed");
}
}
}
Reply
Answers (
1
)
Assembly related problem after creating setup.
data binding