I am getting an error: ERROR [07002] [Microsoft][ODBC Microsoft Access
Driver] Too few parameters. Expected 1 with the following code:
public static string GetTitle(int CatID)
{
OdbcConnection conn = new
OdbcConnection( ConfigurationSe ttings.AppSetti ngs["ConnString "]);
OdbcCommand command = new OdbcCommand("SE LECT Category FROM Categories
WHERE CategoryID = @CID", conn);
conn.Open();
command.Paramet ers.Add(new OdbcParameter(" @CID", OdbcType.Int));
command.Paramet ers["@CID"].Value = CatID;
OdbcDataReader reader =
command.Execute Reader(CommandB ehavior.CloseCo nnection);
reader.Read();
string s = Convert.ToStrin g(reader["Category"]);
conn.Close();
return s;
}
I have to use a DSN and the ODBC Connection. Is it a problem with my
parameter?
Thanks,
Marty
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!