title: C# passing a string to an Sqlite parameter
body: <p>I'm trying to pass a string (the output of a function) to an SqLite query and have it update a database with it. I get an error telling me that string is not a valid data type. </p>
  
  <pre><code>  IList&lt;string&gt; classList = new List&lt;string&gt;(){ "Saber", "Archer", "Lancer", "Rider",
       "Caster", "Assassin", "Berserker", "Ruler", "Avenger", "Moon Cancer"};
      public string setClass(int uid)
      {
          string newClass;
          int remainder = uid % 10;
          newClass = classList[remainder];
          return(newClass);
      }
      [NadekoCommand, Usage, Description, Aliases]
      public async Task initialiseClasses()
      {
          using (SqliteConnection _db = new SqliteConnection(@"Filename=.\myDb.db"))
          {
              _db.Open();
              string newSQL = "ALTER TABLE DiscordUser ADD Class char";
              SqliteCommand command = new SqliteCommand(newSQL, _db);
              command.ExecuteReader();
              string tempClass = setClass(7);  //temporary input
              newSQL = "UPDATE DiscordUser SET Class = @newClass";
              command.Parameters.Add(new SqliteParameter("@newClass", SqliteType.Text).Value = tempClass);
              command = new SqliteCommand(newSQL, _db);
              command.ExecuteReader();
          }
      }
  </code></pre>
  
  <p>I'm trying to pass tempClass into the Sqlite query.</p>