# How to put commands into local database in c# visual studio for voice recognition

How can i add local database for voice recognition for visual studio c#. I want to get the commands from the database and also the function for send-keys I want to get it from the database how will I do that?

The easiest way is by using System. Speech. Recognition; here is described how to use it

Just change this code:

colors.Add(new string[] { "red", "green", "blue" });


And add results of a database query, for example, with Entity Framework and LINQ instead of new string [] {"red", "green", "blue"}. Something like this:

WordsToRecognize.Add(
context.MyTable
.Where(x => x.Type == "type")
.Select(x => new { x.Text }).ToList());


I'm not tested the code above, it just pseudocode