ERROR No value given for one or more required parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganeshj
    New Member
    • Jan 2007
    • 1

    ERROR No value given for one or more required parameters

    I am trying to fetch a data from Acess database for perticular condition but it shows the above mentioned error.. and code is as follows...

    string o;
    string cmdtext = "Select Power_Math From Symbol_List where TeX= " & q ;
    con.Open();
    SelectEntity = new OleDbCommand(cm dtext, con);
    rdr = SelectEntity.Ex ecuteReader(Com mandBehavior.Si ngleResult);
    while (rdr.Read())
    {
    o = (rdr["Power_Math "].ToString());

    }
    rdr.Close();
    con.Close();

    please help....

    thanx
  • jaketrimble
    New Member
    • Jan 2007
    • 14

    #2
    Originally posted by ganeshj
    I am trying to fetch a data from Acess database for perticular condition but it shows the above mentioned error.. and code is as follows...

    string o;
    string cmdtext = "Select Power_Math From Symbol_List where TeX= " & q ;
    con.Open();
    SelectEntity = new OleDbCommand(cm dtext, con);
    rdr = SelectEntity.Ex ecuteReader(Com mandBehavior.Si ngleResult);
    while (rdr.Read())
    {
    o = (rdr["Power_Math "].ToString());

    }
    rdr.Close();
    con.Close();

    please help....

    thanx
    that error is coming from your SQL string...

    what is "q" equal to?

    i did not see it defined in your previous post.

    make sure even if "q" is defined, that it has a value assigned to it...

    also if "q" is a string, you will need to change your syntax...

    Code:
    TeX='" & q & "'
    if you need anything else, let me know!

    Comment

    Working...