Para ese mismo boton intente usar el elemento SqlDataReader de una forma muy parecida al DataTable pero tampoco funciono, dejo el codigo del metodo consultar donde uso el DataReader:
Código:
public SqlDataReader Consultar(int userID)
{
SqlDataReader Lector = null;
if (Conectar(Properties.Settings.Default.strUser, Properties.Settings.Default.strPass))
{
SqlCommand comando = new SqlCommand();
try
{
conexion.Open();
comando.CommandText = "SELECT * FROM USUARIO WHERE userID = @userID";
comando.Parameters.Clear();
SqlParameter param_userID = new SqlParameter("@userID", SqlDbType.Int);
param_userID.Value = userID;
comando.Parameters.Add(param_userID);
Lector = comando.ExecuteReader();
//Lector.Read();
}
catch
{
}
finally
{
if (Lector != null)
Lector.Close();
conexion.Close();
}
return Lector;
}
return Lector;
}