I want to retrieve value from table. Please guys help me. The thing is I want to get that value and check it with a string value.
this code is not working:
SqlCeCommand cmd1 = new SqlCeCommand("SELECT username FROM tmpusername WHERE _id=1", connection);
SqlCeDataReader usernameRdr = null;
usernameRdr = cmd1.ExecuteReader();
while (usernameRdr.Read()){
string username11 = usernameRdr["username11"].ToString();
}
use username
for accessing column.
string username11 = usernameRdr["username"].ToString();
Your select command is specifying Select username
and later you are accessing it using username11
. That is why you are not getting the value, instead you should be getting an exception.