Timer Display data from database
-
Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac
-
Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac
where do you and which way do you want show the data?:confused::confused: you can read the data at a time and simply use a timer to display on time:cool:
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
-
where do you and which way do you want show the data?:confused::confused: you can read the data at a time and simply use a timer to display on time:cool:
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
I have done something like the code below. It will display the data but, it won't display for 10 seconds it will read all the data from database then only the timer stop for 10 seconds. What i'm expected is, each data display at 10 seconds of time then only continue to the next data and so on... public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }
-
Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac
simple dude ........if u have a auto number or a counter in ur database then u can do it .................... step 1: start the timer in form load step 2: write a event ............ step 3: assign that event to timer srep 4: write a perfect query in event like "select * from tablename where counter = @counter"; step 5; add the parameter n assign it to a integer which will increement each time the event is triggered step 6 : last but not the least assign the output to a grid ........ important clear the grid each time
its me sid
-
simple dude ........if u have a auto number or a counter in ur database then u can do it .................... step 1: start the timer in form load step 2: write a event ............ step 3: assign that event to timer srep 4: write a perfect query in event like "select * from tablename where counter = @counter"; step 5; add the parameter n assign it to a integer which will increement each time the event is triggered step 6 : last but not the least assign the output to a grid ........ important clear the grid each time
its me sid
Dude..have done like the code below but the data cannot display for 10secs. public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }
-
Dude..have done like the code below but the data cannot display for 10secs. public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }
i dint get u...data is not at all displayed or its blinking...?
its me sid
-
Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac
Hi. You can use above meta tag which refresh every 5 seconds your page. U can use it in also. I hope can help this. Thanks :laugh: <div class="ForumSig">"Good Thing Goes With Good People..."</div></x-turndown>
-
I have done something like the code below. It will display the data but, it won't display for 10 seconds it will read all the data from database then only the timer stop for 10 seconds. What i'm expected is, each data display at 10 seconds of time then only continue to the next data and so on... public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }
Hi Jacklynn, i see in your code the myTimer.Stop(); while reading from the db, where is the myTimer.Start();?? Nassos
GanDad
-
i dint get u...data is not at all displayed or its blinking...?
its me sid
Mmm..it's like blinking. Supposed that, the output is 10secs for each data to be displayed.