MySqlConnection connection = new MySqlConnection(strConnection);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader reader;
command.CommandText = pQuery;
connection.Open();
reader = command.ExecuteReader();
var dataTable = new DataTable();
dataTable.Load(reader);
connection.Close();
I took the query from text box , I don't want user to delete or change the data in database using text box
how to restrict the command to only select command
thank you
you can create user in your database who have only the select permission , and connect to the database using that user. Or you can check the user input if its contains "delete" keyword using Contains Method