title: DbString, IsFixedLength and IsAnsi for varchar
body: <p>I am new to Dapper, want to know why below is suggested, when my code runs without it?</p>
  <blockquote>
  <p><a href="https://github.com/StackExchange/Dapper#ansi-strings-and-varchar" rel="nofollow noreferrer">Ansi Strings and varchar</a></p>
  <p>Dapper supports varchar params, if you are executing a where clause on
  a varchar column using a param be sure to pass it in this way:</p>
  <pre><code> Query&lt;Thing&gt;(&quot;select * from Thing where Name = @Name&quot;, new {Name = new
   DbString { Value = &quot;abcde&quot;, IsFixedLength = true, Length = 10, IsAnsi
   = true });
  </code></pre>
  <p>On SQL Server it is crucial to use the unicode when querying unicode
  and ansi when querying non unicode.</p>
  </blockquote>
  <p>Below is my code, which runs against SQL server 2012 without using DbString etc.</p>
  <pre><code>create table Author (
   Id int identity(1,1),
   FirstName varchar(50),
   LastName varchar(50)
  );
  go
  insert into Author (FirstName, LastName) values ('Tom', 'John');
  
          public Author FindByVarchar(string firstName)
          {
              using (IDbConnection db = DBHelper.NewSqlConnection())
              {
                  return db.Query&lt;Author&gt;(&quot;Select * From Author WHERE FirstName = @firstName&quot;, new { firstName }).SingleOrDefault();
              }
          }
  </code></pre>
  <p><strong>Questions:</strong></p>
  <p>1 Why is DbString type used in this case?</p>
  <p>2 Why the length is set to 10 (e.g.Length = 10) when &quot;abcde&quot; is 5?</p>
  <p>3 Do I still need to use DbString when my current code works?</p>
  <p>4 Is it correct to set IsAnsi = false for unicode column?</p>
  <p>5 For varchar column, is it correct to set IsFixedLength = false, and ignore setting Length?</p>