Introduction
Artificial Intelligence is built to perform smart tasks. This application shows the login detail record values based on a SQL store procedure. Voice recognition receives the input string value showing the output parameters. First, we must create a simple SQL database. Then create a simple table and insert some sample values.
SQL Database Process
Step 1 - SQL Database Creation
The database name is MobileContact.

- CREATE DATABASE MobileContact;
Step 2 - Create a sample table
The Table name is Contact.
- CREATE TABLE Contact (
- ID int NOT NULL,
- Username nchar(10),
- Mobile nchar(10)
- PRIMARY KEY (ID),
- pword nchar(10),
- MailID nchar(20)
- );
Step 3 - Inserting Sample Records
- insert into Contact(Username,Mobile, pword, MailID) Values('Barath','12345', ‘test123 ’,’ BarathID’);
Step 4 - Create the Random select Procedure
The randomly selected procedure name is the login.
- Create PROCEDURE login @ID nchar(10)
- AS
- Select * from Contact where ID=@ID
- go
Step 5
Declare the Class Headers. (Speech.Recognition, Speech.Synthesis, System.Data, System.SqlClient)
- using System.Speech.Recognition;
- using System.Speech.Synthesis;
- using System.Data;
- using System.Data.SqlClient;
- public static string sqlDataSource = "Data Source=DESKTOP-UG1HSPR\\SQLEXPRESS;Initial Catalog=MobileContact;Integrated Security=True";
Sample Code of Console Application
- The console application is suitable for C# AI development.
- In an open-source operating system and in the testing process it's easy to add more reference edition classes.
- It has a low build time.
Create a new project

Step 2
Select Console Application

Step 3
Open Program.cs to type the below code
Explanation of RecognizeSpeechAndWriteToConsole()
After creating a Recognize speech and write to console, recognize that the string value has loaded grammar. If speech is recognized, call the specified method. Then Set the input to the default audio device to Recognize speech asynchronously.


Join the conversation! Your thoughts help the community grow.