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! ";
- }
- }
- }
- }
- }
- }
- }