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
deepa ashwi
NA
109
602.9k
id not getting incremented in database in c#asp.net
Jul 30 2013 9:36 PM
In userlogin history i want to dispaly the records according to username,logintime ,logouttime,formname(what all the forms users so long visited list)but here the id(i.e in my project i am using uno) is not getting incremented in database how to make it to get increment..can anyone help me with his
following is my code:
protected void Page_Load(object sender, EventArgs e)
{
int uno = 0;
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["constr"]);
con.Open();
string s = "select max(uno) as uno from PayLoginHistory";
SqlDataAdapter da = new SqlDataAdapter(s, con);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 1)
{
uno = uno + 1;
}
if (Convert.ToString(uno) == "")
{
uno = uno + 1;
}
else
{
uno = uno + 1;
}
Session["uno"] = Convert.ToString(uno);
}
Reply
Answers (
5
)
CheckBoxList
Offline Storage