Abraham Olatubosun

Abraham Olatubosun

  • NA
  • 471
  • 107.5k

Able to write to asp.Net listbox one record id at a time

Mar 4 2019 2:58 PM
Dear all,
 
I want to trust that this mail meet you all in good health, i am processing some records from a database, i want each record unique id to be written into an asp.net ListBox after it has been processed,
 
i have tried
  1. string SQLS = "Select * from Patient_Identifier where Patient_id <> '10'";  
  2.        var DF = new DataTable();  
  3.        DF = conn.GetMySQL(ref SQLS);  
  4.        foreach (DataRow p in DF.Rows)  
  5.        {  
  6.       PUID = p["identifier"].ToString().Trim();  
  7.   
  8.            ListBox1.Items.Add(PUID + " added to Person and Patient Successfully..");  
  9.            PUID = "";  
  10.            cnt++;  
  11.              
  12.        }  
 the above sample will write these records ID at once into the ASP.NET ListBox, what i wanted is as after each record is processed it will write it unique ID to the ListBox before processing another one.
 
Thank you for yor help 

Answers (2)