Higuys,
I have a toolstripcombobox that i want to populate data to froma sql table. I have got this to work however the problem i have is the information is duplicated and does not stop displaying, it just keeps going and going. Here is the code i have used.
| privatevoidtimer1_Tick(objectsender,EventArgse) |
| { |
|
|
|
| toolStripComboBox1.Text=""; |
| |
| stringconnectionString="DataSource=sql.support.co.uk;InitialCatalog=support;PersistSecurityInfo=True;UserID=support;Password="; |
| stringqueryString="SELECTagentFROMGSStatus"; |
| using(SqlConnectionconnection=newSqlConnection(connectionString)) |
| { |
| SqlCommandcommand=newSqlCommand(queryString,connection); |
| connection.Open(); |
| SqlDataReaderreader=command.ExecuteReader(); |
| while(reader.Read()) |
| { |
| intcount=reader.FieldCount; |
| for(inti=0;i<count;i++) |
| toolStripComboBox1.Text+=System.Convert.ToString(reader[i])+""; |
| toolStripComboBox1.Text+="\n"; |
| } |
| reader.Close(); |
| } |
| } |
Any ideas?
Thanks