title: C# with MS Access Database Error = Use of unassigned local variable
body: <p>here is the code is self, its inside a class</p>
  
  <pre><code> class Class1
  {
      public string compute (string no1, string no2)
      {
          string computed;
          if (Convert.ToInt32(no1) - 8 == 0)
          {
              if (Convert.ToInt32(no2) &gt; 0)
              {
                  computed = (60 / Convert.ToInt32(no2)).ToString();
              }
              if (Convert.ToUInt32(no2) == 0)
              {
                  computed = "0";
              }
          }
          if (Convert.ToInt32(no1) - 8 != 1)
          {
              if (Convert.ToInt32(no2) &gt; 0)
              {
                  computed = ((Convert.ToInt32(no1) - 8) + (60 / Convert.ToInt32(no2)).ToString();
              }
              if (Convert.ToInt32(no2) == 0)
              {
                  computed = ((Convert.ToInt32(no1) - 8)).ToString();
              }
          }
          return computed;
      }
  }
  </code></pre>
  
  <p>Ive also tried to use the code directly in the main form but i cant use it on a CommandText,</p>
  
  <pre><code>           connect.Open();
             OleDbCommand command = new OleDbCommand();
             command.Connection = connect;
             command.CommandText = "update Table1 set ot='"+ computed +"' where Fname = '" + uname+"' ";
             command.ExecuteNonQuery();
             connect.Close();
             MessageBox.Show("Save Complete");
  </code></pre>
  
  <p>also got the same error.</p>
  
  <p><img src="https://i.stack.imgur.com/X8UM8.png" alt=""></p>