Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
Generalreadonly keyword Pin
N8tiv11-Sep-13 20:38
N8tiv11-Sep-13 20:38 
GeneralRe: readonly keyword Pin
Pete O'Hanlon11-Sep-13 21:05
mvePete O'Hanlon11-Sep-13 21:05 
GeneralRe: readonly keyword Pin
N8tiv11-Sep-13 21:18
N8tiv11-Sep-13 21:18 
GeneralRe: readonly keyword Pin
Pete O'Hanlon11-Sep-13 22:58
mvePete O'Hanlon11-Sep-13 22:58 
GeneralRe: readonly keyword Pin
N8tiv11-Sep-13 23:12
N8tiv11-Sep-13 23:12 
GeneralRe: readonly keyword Pin
Abhinav S12-Sep-13 8:22
Abhinav S12-Sep-13 8:22 
GeneralRe: readonly keyword Pin
DaveyM6913-Sep-13 9:40
professionalDaveyM6913-Sep-13 9:40 
Questiondelay and back again record Pin
eng.iris11-Sep-13 18:07
eng.iris11-Sep-13 18:07 
hi there

i have an issue

i have a record that is moving next each time timer interval started >>> also i have a delay button that it must delay a specific record for an interval let say(2 min)
after two minutes its displayed the rest of records in datetable


my idea is >>>

when delay button clicked i move the current record to another datatabbe and after 2 min i restore it back to the original datatable but unfortunately i get an error

"that deleted records cant be inserted " ? even if i refreshed my datasource


not i am using timers
can some one help or give me another idea or a solution

here is my code

delay button
C#
<pre lang="cs">int x;

            x = Convert.ToInt16(pationt_noLabel1.Text);

           var rows = dt.Select("pationt_no=" + x);
                 foreach (var r in rows)
           {
               delayed.ImportRow(r);
               r.Delete();

           }
           var rowss=delayed.Select("pationt_no="+x);

           foreach (var row in rowss)
           {
               row["test_time"] = DateTime.Now.ToString("hh:mm");
           }

           testsBindingSource.DataSource = dt;
           testsBindingSource.MoveNext();



and my delay method

C#
testsBindingSource.EndEdit();

          string time1s = DateTime.Now.ToString("hh:mm");
             if(delayed.Rows.Count==0)
                 return;
            else

          foreach (DataRow dr in delayed.Rows)
          {

              string time2s = dr["test_time"].ToString();
              TimeSpan interval = DateTime.Parse(time2s).AddMinutes(delay_time) - DateTime.Parse(time1s);
              double tot=interval.TotalMinutes;
              if (tot >= 0)
              {
                  dt.ImportRow(dr);
                  testsBindingSource.DataSource = dt;

                  dr.Delete();
                MessageBox.Show(dt.Rows.Count.ToString());


              }
              else
              {
              }


          }


and timer tick

C#
testsBindingSource.DataSource = dt;
           get_printed_tests(dt);
           is_delayed(2);

AnswerRe: delay and back again record Pin
Eddy Vluggen12-Sep-13 2:58
professionalEddy Vluggen12-Sep-13 2:58 
GeneralRe: delay and back again record Pin
eng.iris12-Sep-13 8:21
eng.iris12-Sep-13 8:21 
GeneralRe: delay and back again record Pin
Eddy Vluggen12-Sep-13 10:42
professionalEddy Vluggen12-Sep-13 10:42 
GeneralRe: delay and back again record Pin
Eddy Vluggen13-Sep-13 7:06
professionalEddy Vluggen13-Sep-13 7:06 
Questiontv show control in c# Pin
eng.iris11-Sep-13 17:54
eng.iris11-Sep-13 17:54 
AnswerRe: tv show control in c# Pin
Abhinav S11-Sep-13 18:24
Abhinav S11-Sep-13 18:24 
General"this" keyword Pin
N8tiv11-Sep-13 17:17
N8tiv11-Sep-13 17:17 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 17:35
professionalRon Beyer11-Sep-13 17:35 
GeneralRe: "this" keyword Pin
N8tiv11-Sep-13 18:08
N8tiv11-Sep-13 18:08 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 18:15
professionalRon Beyer11-Sep-13 18:15 
GeneralRe: "this" keyword Pin
N8tiv11-Sep-13 18:26
N8tiv11-Sep-13 18:26 
GeneralRe: "this" keyword Pin
Ron Beyer11-Sep-13 18:50
professionalRon Beyer11-Sep-13 18:50 
GeneralRe: "this" keyword Pin
Abhinav S11-Sep-13 18:23
Abhinav S11-Sep-13 18:23 
GeneralRe: "this" keyword Pin
V.11-Sep-13 21:49
professionalV.11-Sep-13 21:49 
QuestionDrawing a line that follows a moving point Pin
Davebandit11-Sep-13 4:40
Davebandit11-Sep-13 4:40 
AnswerRe: Drawing a line that follows a moving point Pin
Richard MacCutchan11-Sep-13 6:22
mveRichard MacCutchan11-Sep-13 6:22 
GeneralRe: Drawing a line that follows a moving point Pin
Davebandit11-Sep-13 8:28
Davebandit11-Sep-13 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.