G
Guest
Prepared statement '(@KeyNo int, @Key sql_variant) SELECT KeyNo, Key' expects
parameter @KeyNo, which was not supplied.
The following code snippet gives me the above error, what the heck does this
error mean? @KeyNo was supplied, what is it asking for?
SqlCommand mySelectCmd = new SqlCommand();
mySelectCmd.Connection = myConn;
mySelectCmd.Parameters.Add("@KeyNo", SqlDbType.Int, 10, "KeyNo");
mySelectCmd.Parameters.Add("@Key", SqlDbType.Variant, 255, "Key");
mySelectCmd.CommandText = "SELECT KeyNo, Key FROM KeyTable ";
SqlDataAdapter myDA = new SqlDataAdapter();
DataSet myDS = new DataSet();
myDA.SelectCommand = mySelectCmd;
myDA.Fill(myDS,"KeyTable");
parameter @KeyNo, which was not supplied.
The following code snippet gives me the above error, what the heck does this
error mean? @KeyNo was supplied, what is it asking for?
SqlCommand mySelectCmd = new SqlCommand();
mySelectCmd.Connection = myConn;
mySelectCmd.Parameters.Add("@KeyNo", SqlDbType.Int, 10, "KeyNo");
mySelectCmd.Parameters.Add("@Key", SqlDbType.Variant, 255, "Key");
mySelectCmd.CommandText = "SELECT KeyNo, Key FROM KeyTable ";
SqlDataAdapter myDA = new SqlDataAdapter();
DataSet myDS = new DataSet();
myDA.SelectCommand = mySelectCmd;
myDA.Fill(myDS,"KeyTable");