Helloo, everyone. I have a problem with If statement. Where I'm wrong?
 int cnt = 0;
 int wayListNums;
 foreach (TableRow tr in allVisibleRows)
 {
   SPListItem itemAdd = wayList.Items.Add();
   if (cnt == 0) 
   {
      wayListNums = itemAdd.ID; 
   }      
   itemAdd["wayNum"] = "WayBill № " + " " + wayListNums;
   ...................
This is following error :
Error 1 Use of unassigned local variable 'wayListNums' ....
 
     
     
     
     
    