User54078450 posted
Hi guys . I have a form with the following code in it's on_load.
public partial class ResetPassword : System.Web.UI.Page
{
string RetrievedValue;
protected void Page_Load(object sender, EventArgs e)
{
this.LblUserID.Text = Request.QueryString["UserID"];
RetrievedValue = this.LblUserID.Text;
string connString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data source =" + (Request.PhysicalApplicationPath + "App_Data\\Information.accdb");
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT Question FROM Buyers WHERE UserID = Roelofjvv";
OleDbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
string question = (string)reader["Question"];
LblQuestion.Text = question;
}
conn.Close();
}
When i run the code it throws me a error at line --OleDbDataReader reader = cmd.ExecuteReader();--
The error : No value given for one or more required parameters.
Any help will be appriciated
Thanks