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 display output one by one in label
Mar 29 2018 7:55 PM
Currently i'm working on lucky draw system. I've already can call out the result when clicking button draw. But i want it to show one by one or with some animated function on output. Can anyone share some ideas/ solution. Thanks.
using
System;
using
System.Collections.Generic;
using
System.Configuration;
using
System.Data;
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)
{
string
query =
"SELECT TOP 1[EMP_ID]FROM EMPLOYEES WHERE[Attendance] = 'Present'ORDER BY NEWID()"
;
using
(SqlConnection con =
new
SqlConnection(constr))
{
using
(SqlCommand cmd =
new
SqlCommand(query))
{
using
(SqlDataAdapter sda =
new
SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using
(DataTable dt =
new
DataTable())
{
sda.Fill(dt);
if
(dt.Rows.Count > 0)
{
Label1.Text = dt.Rows[0][
"EMP_ID"
].ToString();
}
else
{
Label1.Text +=
"Cannot draw! "
;
}
}
}
}
}
}
}
Reply
Answers (
2
)
How to separate time from db datetime?
retrieve data from azure table storage.