EStallworth
Well-known member
I am creating an app that has been using mainly SQL server connections. I now am having to connect to an Informix DB using ODBC. My question is why I am getting an error when I my parameters are in the same format that I had been using. I am assuming that I will have to actually create a parameters collection instead of just defining it. I am reading the MSDN llibrary and the reference book I have as well. But if anyone can explain it or just tell me why, I would very much appreciate it.
SELECT trans_no, trans_date, check_no, trans_amt, vend_no
FROM informix.transact
WHERE (vend_no = @Param1)
Then I define @Param1 with
OdbcDataAdapter1.SelectCommand.Parameters("@Param1").Value = Combobox1.Text
I get an error that says "An Odbc Parameter with the Parameter name 'Param1' is not contained by this Odbc Parameter Collection."
SELECT trans_no, trans_date, check_no, trans_amt, vend_no
FROM informix.transact
WHERE (vend_no = @Param1)
Then I define @Param1 with
OdbcDataAdapter1.SelectCommand.Parameters("@Param1").Value = Combobox1.Text
I get an error that says "An Odbc Parameter with the Parameter name 'Param1' is not contained by this Odbc Parameter Collection."