Home > Net >  Ado, please parametric setup problem
Ado, please parametric setup problem

Time:02-25

Cmd.Com mandText="select * from t_user where name=@ nm and tt=@ test".
CMD. The Parameters. AddWithValue (" @ nm ", "admin");
CMD. The Parameters. AddWithValue (" @ test ", "t1");
SqlDataReader Dr=CMD. ExecuteReader ();
Parameters can be set into the case, the swap order
Cmd.Com mandText="select * from t_user where name=@ nm and tt=@ test".
CMD. The Parameters. AddWithValue (" @ test ", "t1");
CMD. The Parameters. AddWithValue (" @ nm ", "admin");
SqlDataReader Dr=CMD. ExecuteReader ();

Why is not the same as the query results, not according to @ behind the name of the set parameters