Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1.         public void DeviceLoop()
  2.         {
  3.             // Select devices from DB
  4.             sampleDataContext dbContext = new sampleDataContext();
  5.             var devicehost = from device in dbContext.Devices
  6.                              select device;
  7.  
  8.             // Loop through devices
  9.             foreach (var host in devicehost)
  10.             {
  11.  
  12.                 // Success - change div class to green/ok colors
  13.                 if (PingHost(host.HostIp))
  14.                 {
  15. Div10 = host.HostDiv; // -----> Cannot implicitly convert type 'string' to 'System.Web.UI.HtmlControls.HtmlGenericControl
  16.                     Div10.Attributes["class"] = "statusok";
  17.                 }
  18.  
  19.                 // Fail - change div class to green/ok colors
  20.                 else
  21.                 {
  22. Div10 = host.HostDiv; // ----->  Cannot implicitly convert type 'string' to 'System.Web.UI.HtmlControls.HtmlGenericControl
  23.                     Div10.Attributes["class"] = "statusbad";
  24.                 }
  25.             }
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement