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
Asyraf MN
NA
28
7.8k
How to select random id from database and display randomly o
Mar 27 2018 2:45 AM
Currently, I'm working on the Lucky Draw system. So the process of the system is when user click on button draw it select a random id from database where table attendance="Present". I also want to make the output display like animated counter number. Can anyone help me on this.Thanks.
I stuck on the background code :
using
System;
using
System.Collections.Generic;
using
System.Configuration;
using
System.Data.SqlClient;
using
System.IO;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public
partial
class
_Default : System.Web.UI.Page
{
string
constr = ConfigurationManager.ConnectionStrings[
"lucky"
].ConnectionString;
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
Button1_Click(
object
sender, EventArgs e)
{
using
(SqlConnection con =
new
SqlConnection(constr))
{
using
(SqlCommand cmd =
new
SqlCommand(
"SELECT TOP 1 id from [dbo].[EMPLOYEES] ORDER BY NEWID()"
))
{
}
}
}
}
This i my EMPLOYEES table :
Reply
Answers (
2
)
How to set limit size of zip file
where and what to add picture property