[Solved] Incorrect syntax near ‘79000’ [closed]


Change your sql statement to

cmd.CommandText = "SELECT CMC, [Site Name], [Phone Number], Zip_Code FROM site Where Zip_Code="" + Zipcode.Text + """;

You are missing the = which is needed for the syntax to be correct.

But you should think about using parameter instead to avoid SQL Injection.

Why do we always prefer using parameters in SQL statements? could be interesting for this, too.

5

solved Incorrect syntax near ‘79000’ [closed]