There are three big things wrong here.
First, a string inside an SQL statement needs to be enclosed in single quotes, like this:
SqlCommand cmd = new SqlCommand($"select * from Flashcard where English = '{englishName}'", SqlConnect);
This might seem to fix your problem all by itself, but things are still pretty bad. Think about what would happen if you have an English name that itself includes a single-quote character in it? The quote would throw the whole query out of whack. Worse, that issue can be used by hackers to do very bad things in your database.
So the second thing to do is to use query parameters:
SqlCommand cmd = new SqlCommand("select * from Flashcard where English = @EnglishName", SqlConnect);
cmd.Parameters.Add("@EnglishName", SqlDbType.NVarChar, 20).Value = englishName;
This will protect you from mis-placed or malicious single quotes, and notice as well that you no longer need to worry about enclosing the value. There a number of other benefits for doing it this way, as well. Query parameters are important. Use them.
Finally, think about what would happen if an exception is thrown by your query. Execution flow would bubble up out of your method, and the .Close() command would never happen. Do this enough, and it's possible to leave enough connections hanging open that you create a denial of service situation on the database... no one can use it! Protect against that with either a using block or try/finally blocks.
There are some other small things, too, but those are the three that are really important. Put it all together like this:
public string AskBaseForPolishName(string englishName)
{
//it's best NOT to re-use the same connection object. Only reuse the same connection string
using (var cn = new SqlConnection("connection string here"))
using (var cmd = new SqlCommand("select Polish from Flashcard where English = @EnglishName;", cn))
{
cmd.Parameters.Add("@EnglishName", SqlDbType.NVarChar, 20).Value = englishName;
cn.Open();
return cmd.ExecuteScalar().ToString();
}
}
usingstatements, also look in toExecuteScalar()instead of usingExecuteReader()