string queryString ="select Name,Email_Id, Mob_No, Dob From UserReg where username =?";
using (OleDbConnection connection =
new OleDbConnection(connectionString))
{
OleDbDataAdapter adapter =
new OleDbDataAdapter(queryString, connection);
adapter.SelectCommand.Parameters.AddWithValue("@p1", Textbox1.Text);
try
{
connection.Open();
adapter.Fill(dt);
}
catch (Exception ex)
{
}
}
return dt;
Reference:
OleDbParameter Class[
^]